Search code examples
tomcatsftpgxtjsch

SFTP in GXT between Windows and Tomcat


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.....


Solution

  • 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.