File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
EJB and other Java EE Technologies
EJB and FTP
John R Roberts
Joined: Dec 27, 2006
Jun 06, 2007 06:29:00
Hi, is is possible to connect to an FTP server from within an App Server?
I have a session bean that calls a worker class to retrieve files via FTP but I keep getting the following exception
java.net.BindException: Cannot assign requested address: bind at sun.nio.ch.Net.bind(Native Method) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) at com.sun.enterprise.server.ss.ASServerSocket.bind(ASServerSocket.java:244) at com.sun.enterprise.server.ss.ASServerSocketImpl.listen(ASServerSocketImpl.java:121) at java.net.ServerSocket.bind(ServerSocket.java:320) at java.net.ServerSocket.<init>(ServerSocket.java:185) at org.apache.commons.net.DefaultSocketFactory.createServerSocket(DefaultSocketFactory.java:155) at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:475) at org.apache.commons.net.ftp.FTPClient.retrieveFileStream(FTPClient.java:1342)
I can run the same code outside the App server and it works fine.
we are using Jakarta Commons FTP library.
Suggestions are apprecriated.
Joined: Jun 10, 2007
Jun 15, 2007 11:20:00
from the error message looks like the process may not have permissions to bind to a local socket. try using passive mode instead. another good component can be found here
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: EJB and FTP
FTP issue (using org.apache.commons.net.ftp)
I won't open a connection to
java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream r
Move file from Windows to FtpServer(Unix)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013