• Post Reply Bookmark Topic Watch Topic
  • New Topic

FTP problem  RSS feed

Satish Varanasi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI EveryBody,
I have prepared a small ftp application which picks up files & pictures from one server & places it on the remote server.i have put a JTimer which runs after every 10 seconds and searches the local server for any stories , if it finds any then it places them at remote server.The problem is i am getting the following exception(most of the time it comes).i am not able to track it.can u please help me out how i can sort it .it's urgent please
Demo of putBinary() function
java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:86)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
at java.io.BufferedInputStream.read(BufferedInputStream.java:204)
at FtpClient.readServerResponse(FtpClient.java:107)
at FtpClient.readReply(FtpClient.java:227)
at FtpClient.issueCommand(FtpClient.java:213)
at FtpClient.issueCommandCheck(FtpClient.java:221)
at FtpClient.binary(FtpClient.java:510)
at newFTPClass43.uploadFile(newFTPClass43.java:503)
at newFTPClass43.getStoryPath(newFTPClass43.java:416)
at newFTPClass43.checkStories(newFTPClass43.java:568)
at newFrame22.StoryCheck(newFrame22.java:430)
at newFrame22$myActionListener1.actionPerformed(newFrame22.java:404)
at javax.swing.Timer.fireActionPerformed(Timer.java:150)
at javax.swing.Timer$DoPostEvent.run(Timer.java:108)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:317)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
i am using an FtpClient class provided by sun.net.ftp
Carl Trusiak
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can, check the server logs for the ftp server you are connecting to. The server could be timing out due to inactivity. Some servers don't consider LIST an activity if no results are returned from that command. If this is the case, put and index.txt in the directory and ignore it in your sweep program(This way the server is always returning something).
I would also consider refactoring this system, can you run something to sweep the directory on the server? It would actually be less overhead for the server itself.
Hope this helps
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!