使用IFSFileInputStream连接到iSeries时出现java.netConnectException错误

时间:2010-11-05 13:57:59

标签: java ibm-midrange connectexception

我有一个简单的Java程序(使用JTOpen)连接到iSeries并打开IFS文件:

System.out.println("by ipaddress");
AS400 as400 = new AS400("130.3.3.333", "user", "password");
System.out.println("as400 connected? = " + as400.getCcsid());
//handle the exception if the file is null 
IFSFileInputStream as400File = new IFSFileInputStream(as400, "//PDF//00000104.PDF");
System.out.println("is available" + as400File.getPath());
as400File.close();

在DMZ中的一台服务器上,一切正常,但在不同建筑物(仍在DMZ中)的服务器上的(假设相同的)VM映像上,我收到错误:

by ipaddress
as400 connected? = 37
IO security exception
java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at com.ibm.as400.access.PortMapper.getServerSocket(PortMapper.java:170)
    at com.ibm.as400.access.AS400ImplRemote.getConnection(AS400ImplRemote.ja
va:975)
    at com.ibm.as400.access.AS400ImplRemote.connect(AS400ImplRemote.java:390
)
    at com.ibm.as400.access.AS400.connectService(AS400.java:870)
    at com.ibm.as400.access.IFSFileInputStream.connectAndOpen(IFSFileInputSt
ream.java:416)
    at com.ibm.as400.access.IFSFileInputStream.<init>(IFSFileInputStream.jav
a:150)
    at com.ibm.as400.access.IFSFileInputStream.<init>(IFSFileInputStream.jav

连接正常,但后来获得连接异常。

欢迎任何想法。在两个服务器与iSeries之间的防火墙中打开了相同的端口。

1 个答案:

答案 0 :(得分:2)

每个端口上都有多个服务,初始连接只打开一个。检查jt400 faq以获取文件服务。我希望这个端口在防火墙中不打开。