This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Getting File Not Found Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Getting File Not Found Exception" Watch "Getting File Not Found Exception" New topic
Author

Getting File Not Found Exception

Kamal Bindra
Greenhorn

Joined: May 18, 2012
Posts: 8
Hi,

I am trying to upload a file to a ftp using sftp. when i try to upload the same file within an interval of 10 sec it behaves abnormaly.
It shows upload status as true for 2 attempts but shows the following logs with another attempt:

+++ Exception generated : com.sshtools.j2ssh.sftp.SftpSubsystemClient.getHandleResponse(Unknown Source)
com.sshtools.j2ssh.sftp.SftpSubsystemClient.openFile(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.hds.sei.service.impl.FTPCSVUploadBusinessService.uploadCSVToFtp(FTPCSVUploadBusinessService.java:92)
com.hds.sei.service.impl.UploadProcessBusinessService.uploadParsedCSVFile(UploadProcessBusinessService.java:200)
com.hds.sei.service.impl.UploadProcessBusinessService.run(UploadProcessBusinessService.java:180)
com.hds.sei.threadpool.SubTPRunnable.run(SubTPRunnable.java:54)
com.hds.sei.threadpool.SystemThreadPool$TimedRunnable.run(SystemThreadPool.java:34)
com.hds.sei.threadpool.SimpleThreadPoolThread.run(SimpleThreadPoolThread.java:51)

CSV file Location for upload to FTP : D:/csv
ERROR 2012-05-18 12:19:50,143 (FTPCSVUploadBusinessService.java:108) - ====Exception : File not found

When i look into the location for file to upload to ftp, it exists at that location.Please help me with the cause for this exception and a resolution will be highly appreciated.

Thanks,
Kamal
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38463
    
  23
Welcome to the Ranch

Please check that the file is accessible and that you have read permission on it. If you try to read a write-only file, or the file is locked by another application, for example, you suffer the same sort of exception.
Kamal Bindra
Greenhorn

Joined: May 18, 2012
Posts: 8
Hi Campbell,

Thanks for your quick reply.
I tried to find the file permissions and found that it has both read and write permissions.
I am getting the same logs.

INFO 2012-05-21 11:16:10,876 (FTPCSVUploadBusinessService.java:85) - fileLocation2 is : D:\csv\1-98T567.csv
INFO 2012-05-21 11:16:10,876 (FTPCSVUploadBusinessService.java:88) - File2 exists...
INFO 2012-05-21 11:16:10,876 (FTPCSVUploadBusinessService.java:92) - Can Read.........
INFO 2012-05-21 11:16:10,876 (FTPCSVUploadBusinessService.java:96) - Can Write.........
ERROR 2012-05-21 11:16:14,218 (FTPCSVUploadBusinessService.java:111) - +++ Exception generated : com.sshtools.j2ssh.sftp.SftpSubsystemClient.getHandleResponse(Unknown Source)
com.sshtools.j2ssh.sftp.SftpSubsystemClient.openFile(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.hds.sei.service.impl.FTPCSVUploadBusinessService.uploadCSVToFtp(FTPCSVUploadBusinessService.java:99)
com.hds.sei.service.impl.UploadProcessBusinessService.uploadParsedCSVFile(UploadProcessBusinessService.java:212)
com.hds.sei.service.impl.UploadProcessBusinessService.run(UploadProcessBusinessService.java:182)
com.hds.sei.threadpool.SubTPRunnable.run(SubTPRunnable.java:54)
com.hds.sei.threadpool.SystemThreadPool$TimedRunnable.run(SystemThreadPool.java:34)
com.hds.sei.threadpool.SimpleThreadPoolThread.run(SimpleThreadPoolThread.java:51)

Folder location for CSV file : /import
CSV file Location for upload to FTP : D:/csv
ERROR 2012-05-21 11:16:14,218 (FTPCSVUploadBusinessService.java:115) - ====Exception : File not found


Please help me with some resolution for this issue.

Thanks,
Kamal
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38463
    
  23
I shall move this question because it is too difficult for “beginning”.
Kamal Bindra
Greenhorn

Joined: May 18, 2012
Posts: 8
Hi Campbell,

Under which java forum i can find resolution to this issue.

Thanks,
Kamal
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1505
    
    5

Kamal Bindra wrote:Hi Campbell,

Under which java forum i can find resolution to this issue.

Thanks,
Kamal

The topic still can be seen in original forum (where you've started it - I guess that is 'Beginning Java'), however, when you open the post, you can see in which forum you are by taking a look at top of the first post (currently, the topic is in 'Java in General' forum).

I hope this helps.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Kamal Bindra
Greenhorn

Joined: May 18, 2012
Posts: 8
Hi,

If anyone can please help me with this issue in this forum.
Any help will be highly appreciated.

Thanks,
Kamal
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38463
    
  23
I don’t know myself.
I presume your file is not in use by any other programs? How are you identifying the file? Are you using a file chooser? Can you list the contents of the remote directory?
Apart from that, don’t know. And please don’t keep reminding us of the problem; such reminders do not produce quicker answers.
gangadhar mundluru
Greenhorn

Joined: Nov 15, 2007
Posts: 1
Kamal Bindra wrote:Hi,

I am trying to upload a file to a ftp using sftp. when i try to upload the same file within an interval of 10 sec it behaves abnormaly.
It shows upload status as true for 2 attempts but shows the following logs with another attempt:

+++ Exception generated : com.sshtools.j2ssh.sftp.SftpSubsystemClient.getHandleResponse(Unknown Source)
com.sshtools.j2ssh.sftp.SftpSubsystemClient.openFile(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.sshtools.j2ssh.SftpClient.put(Unknown Source)
com.hds.sei.service.impl.FTPCSVUploadBusinessService.uploadCSVToFtp(FTPCSVUploadBusinessService.java:92)
com.hds.sei.service.impl.UploadProcessBusinessService.uploadParsedCSVFile(UploadProcessBusinessService.java:200)
com.hds.sei.service.impl.UploadProcessBusinessService.run(UploadProcessBusinessService.java:180)
com.hds.sei.threadpool.SubTPRunnable.run(SubTPRunnable.java:54)
com.hds.sei.threadpool.SystemThreadPool$TimedRunnable.run(SystemThreadPool.java:34)
com.hds.sei.threadpool.SimpleThreadPoolThread.run(SimpleThreadPoolThread.java:51)

CSV file Location for upload to FTP : D:/csv
ERROR 2012-05-18 12:19:50,143 (FTPCSVUploadBusinessService.java:108) - ====Exception : File not found

When i look into the location for file to upload to ftp, it exists at that location.Please help me with the cause for this exception and a resolution will be highly appreciated.

Thanks,
Kamal



Hi Kamal,

Did you get any solution for this issue? I have also same issue. But I am getting the same exception when I use SftpClient.ls() method. It works some times and some times it will not work.
Please let me know, if you have any solution.
 
 
subject: Getting File Not Found Exception