Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Connection timed out: Could be due to invalid connection  RSS feed

 
Ralph Philistine
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have Apache FTPServer implemented on a production aix machine. The user can log in but when they attempt to send a file I get the following error:
[ WARN] 2007-11-28 10:14:59,850 FtpDataConnection.getDataSocket()
java.net.SocketException: Connection timed out:could be due to invalid address
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:336)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:201)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:188)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.connect(Socket.java:428)
at java.net.Socket.<init>(Socket.java:335)
at java.net.Socket.<init>(Socket.java:179)
at org.apache.ftpserver.FtpDataConnection.getDataSocket(FtpDataConnectio
n.java:202)
at org.apache.ftpserver.FtpRequestImpl.getDataInputStream(FtpRequestImpl
.java:318)
at org.apache.ftpserver.command.STOR.execute(STOR.java:110)
at org.apache.ftpserver.RequestHandler.service(RequestHandler.java:282)
at org.apache.ftpserver.RequestHandler.run(RequestHandler.java:244)
at java.lang.Thread.run(Thread.java:568)



I have highlighted where this occurs in the following method. This is when the service attempts to establish a socket for the user to use to send the file:
public synchronized Socket getDataSocket() {

// get socket depending on the selection
dataSoc = null;
IDataConnectionConfig dataConfig = fconfig.getDataConnectionConf();
try {
if(isPort) {
int localPort = dataConfig.getActiveLocalPort();
if(secure) {
ISsl ssl = dataConfig.getSSL();
if(ssl == null) {
throw new FtpException("Data connection SSL not configured");
}
if(localPort == 0) {
dataSoc = ssl.createSocket(null, address, port, false);
}
else {
InetAddress localAddr = dataConfig.getActiveLocalAddress();
dataSoc = ssl.createSocket(null, address, port, localAddr, localPort, false);
}
}
else {
if(localPort == 0) {
>>> dataSoc = new Socket(address, port);
}
else {
InetAddress localAddr = dataConfig.getActiveLocalAddress();
dataSoc = new Socket(address, port, localAddr, localPort);
}
}
}
else if(isPasv) {
dataSoc = servSoc.accept();
}
}
catch(Exception ex) {
closeDataSocket();
log.warn("FtpDataConnection.getDataSocket()", ex);
}

return dataSoc;
}

When I run the service on my development server it works fine. Can anyone tell me whether or not this is happening due to filewall restrictions or some other configuration issue on the production server? If it is firewall related how can articulate to my infrastructure staff what I suspect the problem is?

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!