在使用WebSphere客户端SDK中的AdminClient远程安装EAR文件时,我获得了UnknownHostException
。
无论如何都要跳过AdminClient的主机名检查?或强制AdminClient仅使用IP。
我们公司的DNS可能存在问题,但我无法配置。
完全例外:
2016-11-17 10:53:08 [main] ERROR c.i.w.m.f.c.FileTransferClientImpl - ADFS0112E: File transfer has failed with the following message: Upload retry limit exceeded for file my.ear. Exception: java.net.UnknownHostException: MYHOST
com.ibm.websphere.management.exception.AdminException: Failure uploading archive to server
at com.ibm.websphere.management.application.AppManagementProxy.uploadArchive(AppManagementProxy.java:732)
at com.ibm.websphere.management.application.AppManagementProxy.installApplication(AppManagementProxy.java:528)
Caused by: com.ibm.websphere.management.filetransfer.client.TransferFailedException: Upload retry limit exceeded for file my.ear. Exception: java.net.UnknownHostException: MYHOST
at com.ibm.ws.management.filetransfer.client.FileTransferClientImpl.uploadFileInternal(FileTransferClientImpl.java:595)
at com.ibm.ws.management.filetransfer.client.FileTransferClientImpl.uploadFile(FileTransferClientImpl.java:462)
at com.ibm.ws.management.filetransfer.client.FileTransferClientImpl.uploadFile(FileTransferClientImpl.java:369)
at com.ibm.ws.management.filetransfer.client.FileTransferClientImpl.uploadFile(FileTransferClientImpl.java:293)
at com.ibm.ws.management.application.client.AppInstallHelper.copyToServer(AppInstallHelper.java:1245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.ibm.websphere.management.application.AppManagementProxy.uploadArchive(AppManagementProxy.java:718)
... 10 more
Caused by: java.net.UnknownHostException: MYHOST
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
at sun.net.www.http.HttpClient.New(HttpClient.java:308)
at sun.net.www.http.HttpClient.New(HttpClient.java:326)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
at com.ibm.ws.management.filetransfer.client.FileTransferClientImpl.connectToServer(FileTransferClientImpl.java:2947)
at com.ibm.ws.management.filetransfer.client.FileTransferClientImpl.openConnection(FileTransferClientImpl.java:2859)
at com.ibm.ws.management.filetransfer.client.FileTransferClientImpl.uploadFileInternal(FileTransferClientImpl.java:547)