快跑蜗牛哥
2018-03-07 07:57
采纳率: 100%
浏览 2.1k

在Linux系统下调用webservice出错,同样的代码在windows下正常。

出错信息如下:

 HTTP Status 500 - Failed to access the WSDL at: http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl. It failed with:
type Exception report

message Failed to access the WSDL at: http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl. It failed with:

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl. It failed with: 
    Got xx.xx.xx.cn while opening stream from http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl.
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:173)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:155)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120)
    com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:258)
    com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:221)
    com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:169)
    com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101)
    javax.xml.ws.Service.<init>(Service.java:77)
    javax.xml.ws.Service.create(Service.java:707)
    gz.doGet(gz.java:54)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

java.io.IOException: Got xx.xx.xx.cn while opening stream from http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:842)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:283)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:140)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120)
    com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:258)
    com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:221)
    com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:169)
    com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101)
    javax.xml.ws.Service.<init>(Service.java:77)
    javax.xml.ws.Service.create(Service.java:707)
    gz.doGet(gz.java:54)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause

java.net.UnknownHostException: xx.xx.xx.cn
    java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
    java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    java.net.Socket.connect(Socket.java:579)
    java.net.Socket.connect(Socket.java:528)
    sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
    sun.net.www.http.HttpClient.New(HttpClient.java:308)
    sun.net.www.http.HttpClient.New(HttpClient.java:326)
    sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)
    sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
    sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
    sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
    java.net.URL.openStream(URL.java:1037)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:827)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:283)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:140)
    com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120)
    com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:258)
    com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:221)
    com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:169)
    com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101)
    javax.xml.ws.Service.<init>(Service.java:77)
    javax.xml.ws.Service.create(Service.java:707)
    gz.doGet(gz.java:54)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.84 logs.

请问 问题出在哪里??

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • 你们都是坏人 2018-03-12 04:05
    已采纳

    可以wget 下载文件,并不代表可以解析域名,
    解决方法:
    vi /etc/resolv.conf

    在 文件中添加
    nameserver 8.8.8.8
    保存后,重启服务
    service network restart

    点赞 打赏 评论
  • dcb19840404 2018-03-07 08:03

    从业8年多的经验来看,此问题很可能是由于两个系统之间的动态库的差异,导致WEB服务无法正常运行,可以通过工具软件查看WEB服务依赖于那些动态库,再做进一步分析判断

    点赞 打赏 评论
  • 花匠小林 2018-03-07 08:30

    linux ping那个xx.xx.xx.cn能ping通不?应该是连接不到的问题,ping一下试试

    点赞 打赏 评论
  • amdkings1 2018-03-09 09:50

    从报告的异常来看是 xx.xx.xx.cn 这个域名不能被DNS正常解析出IP,从这个方向查看一下。nslookup xx.xx.xx.cn 看看能否得到IP,或者直接把域名替换成webservice
    服务器的IP地址试一下

    点赞 打赏 评论

相关推荐 更多相似问题