我正在尝试连接到大型机服务器并提交作业。
我尝试了各种选项,例如Jenkins插件,编写Java程序,使用Widows命令提示符。我似乎陷入了困境。它似乎在等待20秒不活动后的欢迎消息和超时。
使用命令提示符:
ftp> open <IP Address> 23
Connected to <IP Address>.
Connection closed by remote host.
使用示例Java程序:
它停留在ftp.connect(serverName,23);很长一段时间然后抛出以下错误。
java.io.IOException: Timed out waiting for initial connect reply
at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:393)
at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:924)
at org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:207)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:183)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:203)
at com.ivl.util.FileTransferProtocol.main(FileTransferProtocol.java:60)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.read(Unknown Source)
at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:314)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294)
at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:387)
... 5 more
我也尝试使用Filezilla,这是在调试级别设置的filezilla日志。
12:38:36 Status: Connecting to <IP Address>:23...
12:38:36 Status: Connection established, initializing TLS...
12:38:36 Trace: CTlsSocket::Handshake()
12:38:36 Trace: CTlsSocket::ContinueHandshake()
12:38:36 Trace: TLS handshake: About to send CLIENT HELLO
12:38:36 Trace: TLS handshake: Sent CLIENT HELLO
12:38:36 Trace: CTlsSocket::OnSend()
12:38:36 Trace: CTlsSocket::OnRead()
12:38:36 Trace: CTlsSocket::ContinueHandshake()
12:38:36 Trace: CTlsSocket::OnRead()
12:38:36 Trace: CTlsSocket::ContinueHandshake()
12:38:37 Trace: CTlsSocket::OnRead()
12:38:37 Trace: CTlsSocket::ContinueHandshake()
12:38:37 Trace: TLS handshake: Received SERVER HELLO
12:38:37 Trace: TLS handshake: Processed SERVER HELLO
12:38:37 Trace: TLS handshake: Received CERTIFICATE
12:38:37 Trace: TLS handshake: Processed CERTIFICATE
12:38:37 Trace: TLS handshake: Received SERVER HELLO DONE
12:38:37 Trace: TLS handshake: Processed SERVER HELLO DONE
12:38:37 Trace: TLS handshake: About to send CLIENT KEY EXCHANGE
12:38:37 Trace: TLS handshake: Sent CLIENT KEY EXCHANGE
12:38:37 Trace: TLS handshake: About to send FINISHED
12:38:37 Trace: TLS handshake: Sent FINISHED
12:38:37 Trace: CTlsSocket::OnRead()
12:38:37 Trace: CTlsSocket::ContinueHandshake()
12:38:37 Trace: TLS handshake: Received FINISHED
12:38:37 Trace: TLS handshake: Processed FINISHED
12:38:37 Trace: TLS Handshake successful
12:38:37 Trace: Protocol: TLS1.2, Key exchange: RSA, Cipher: AES-256-GCM, MAC: AEAD
12:38:37 Status: Verifying certificate...
12:38:37 Status: TLS connection established, waiting for welcome message...
12:38:37 Trace: CFtpControlSocket::OnReceive()
12:38:57 Error: Connection timed out after 20 seconds of inactivity
12:38:57 Trace: CControlSocket::DoClose(2050)
12:38:57 Trace: CFtpControlSocket::ResetOperation(2114)
12:38:57 Trace: CControlSocket::ResetOperation(2114)
12:38:57 Error: Could not connect to server
12:38:57 Trace: CFileZillaEnginePrivate::ResetOperation(2114)
12:38:57 Status: Waiting to retry...
12:39:00 Trace: CControlSocket::DoClose(64)
12:39:00 Trace: CControlSocket::DoClose(64)
我可以使用Mocha TN3270或任何大型机仿真器连接到同一台服务器。这很奇怪。
我在这里失去了可能导致此问题的原因以及如何解决问题,我的目标是以编程方式连接并提交批处理作业,我可以使用批处理文件,java程序等到目前为止我的所有尝试似乎徒劳无功。
答案 0 :(得分:0)
如果我理解你,你试图用FTP连接到端口23?这不是FTP通常使用的端口。端口23可能是TN3270连接的地方,但FTP可能连接到普通端口21,而Telnet / SSH可能连接到不同的端口 - 您必须向友好的本地sysprog询问端口。
实际上,如果你告诉他们你想要做什么,他们可能会帮助你或者可能告诉你这是不允许的。无论哪种方式,您都应该更快地获得特定于您的环境的真实答案。