您好, 我已经制作了将文件上传到FTP和FTPS(通过TLS / SSL)服务器的代码。它适用于本地eclipse测试,但只有FTPS上传在Oracle java存储过程上运行时才会失败。从连接点来看,它是错误的。
sys info:
import java.io.*;
import java.net.*;
import org.apache.commons.net.ftp.FTPSClient;
public class Test
{
public static void setGroFilesToFtp()
{
FTPSClient ftps = null;
try {
ftps = new FTPSClient();
ftps.connect("host", 21);
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
java.net.SocketException: connect failed, 10022
À߸øµÈ Àμö¸¦ ÀÔ·ÂÇß½À´Ï´Ù.
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java)
at java.net.Socket.connect(Socket.java)
at org.apache.commons.net.SocketClient._connect(SocketClient.java)
at org.apache.commons.net.SocketClient.connect(SocketClient.java)
at FtpTransfer.setGroFilesToFtp(FtpTransfer:22)