-1

I am using Jsch for sftp function. I am encounting a problem that i cannot use sftp service if the application is deployed to tomcat. The sftp function works well when i testing by using eclipse GWT development mode.

Here is the condition:

locationFile : D:\test\testing.txt

sftpHome : /aaa/bbb/ccc/ddd/timeStamp/

I had tried a lot of different way on Windows (GWT Development Mode) and all of them works well.

For example,

InputStream fis = new FileInputStream(locationFile);
sftp.put(fis, locationFile.getName());

Or

sftp.put(new FileInputStream(locationFile), locationFile.getName());

Or

sftp.put(locationFile, locationFile.getName());

Many and many...

But when i deployed to tomcat, all of them is failure. May someone can answer me, which coding i should use so i can get the job done? Here is the target Environment:

User using Windows.

Application developed by GXT/GWT.

The sftp function, of course on server side.

The application is deployed on tomcat (unix machine).

It making me crazy because i don't know what is the problem that making me so messy on this application, my boss are going to kill me because i spend too much time on it.....

Jbisgood9999999
  • 253
  • 1
  • 5
  • 15
  • "when i deployed to tomcat, all of them is failure". Specifically what happens? Do you get any error messages or exceptions? What do they say? Please edit your question to describe how your code is failing. – Kenster Nov 02 '15 at 14:11
  • Also, where is the source file when the application is deployed on tomcat, and how are you specifying the name of the source file? "D:\test\testing.txt" isn't a valid filename on unix. – Kenster Nov 02 '15 at 14:14
  • Hi Kenster, sorry for late reply, java.io.FileNotFoundException: D:\test\testing.txt" (No such file or directory) So i should change it to D:/test/testing.txt ? – Jbisgood9999999 Nov 03 '15 at 01:03

1 Answers1

0

Suddenly i found it is the problem of the cache in browser.

I found this solution / problem because i tried to comment some unused function nut the Application still executing the function and returning the error log.

So in my case, i clean up the cache and the problem solved.

Jbisgood9999999
  • 253
  • 1
  • 5
  • 15