• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting File Not Found Exception  RSS feed

 
Kamal Bindra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I shall move this question because it is too difficult for “beginning”.
 
Kamal Bindra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Campbell,

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

Thanks,
Kamal
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kamal Bindra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks,
Kamal
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!