Exception in thread main com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport e
生活随笔
收集整理的這篇文章主要介紹了
Exception in thread main com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport e
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
摘要:在調用webservice客戶端代碼的時候報如下錯誤
Invoking reportLossByRdid... Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.UnknownHostException: opacat com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:117)at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:194)at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:122)at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:95)at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:626)at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:585)at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:570)at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:467)at com.sun.xml.internal.ws.client.Stub.process(Stub.java:308)at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:163)at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)at com.sun.proxy.$Proxy30.reportLossByRdid(Unknown Source)at com.qdexam.ReaderWebservice_ReaderWebservicePort_Client.main(ReaderWebservice_ReaderWebservicePort_Client.java:60) Caused by: java.net.UnknownHostException: opacat 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:996)at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:975)at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:850)at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1091)at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:105)... 14 more一:問題原因
無法解析該域名,可以將域名對應的ip寫入到hosts文件中保存。
二:解決辦法:
將域名對應的ip寫入到hosts文件中保存
Windows的hosts文件在“C:\windows\system32\drivers\etc”中。
Linux更改hosts的操作如下:
cd /etc/
vi hosts
輸入如下:
# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host# localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost211.151.71.11 opac
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎
總結
以上是生活随笔為你收集整理的Exception in thread main com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport e的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java excel中删除两列_Java
- 下一篇: Eclipse 中修改java编译版本