`
sxdtzhaoxinguo
  • 浏览: 211972 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

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: opac
	at 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: opac
	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: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             localhost
   211.151.71.11	opac



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics