我编写了一个 java 文件,该文件打开一个到服务器的 HTTPS 连接,该服务器提供了从我们的 unix 服务器调用其 Web 服务的受限访问权限。所以我们可以ping服务器ip,用端口443远程登录服务器ip,所以网络团队已经确认我们可以开始调用webservices了。现在我们已经在 Windows 服务器上尝试了一切,将他们提供的证书安装在本地文件夹中,然后简单地运行 jar。我们能够建立连接。现在我们必须迁移到 unix 服务器。我们已将本地证书复制到 jar 中。在运行 jar 时,我们得到以下异常。
java.net.UnknownHostException: wugateway2pi.westernunion.net
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272) at
sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient
(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream
(HttpURLConnection.java:1014)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream
(HttpsURLConnectionImpl.java:230)
at utils.HelloWorld.heartbeat(HelloWorld.java:129)
at utils.HelloWorld.main(HelloWorld.java:492)
TRANSFAST: Some Error occurs during parsing the sendtrnx response
java.lang.IllegalArgumentException: InputStream cannot be null
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:120)
at utils.HelloWorld.heartbeat(HelloWorld.java:160)
at utils.HelloWorld.main(HelloWorld.java:492)
java.lang.RuntimeException: Exception in XML Parsing for the Response:
at utils.HelloWorld.heartbeat(HelloWorld.java:184)
at utils.HelloWorld.main(HelloWorld.java:492)
Calling heartbeat noCall
不知道缺少什么。
问候,瑞奇