快跑蜗牛哥 2018-03-07 07:57 采纳率: 0%
浏览 2253
已采纳

在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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 券商软件上市公司信息获取问题
  • ¥100 ensp启动设备蓝屏,代码clock_watchdog_timeout
  • ¥15 Android studio AVD启动不了
  • ¥15 陆空双模式无人机怎么做
  • ¥15 想咨询点问题,与算法转换,负荷预测,数字孪生有关
  • ¥15 C#中的编译平台的区别影响
  • ¥15 软件供应链安全是跟可靠性有关还是跟安全性有关?
  • ¥15 电脑蓝屏logfilessrtsrttrail问题
  • ¥20 关于wordpress建站遇到的问题!(语言-php)(相关搜索:云服务器)
  • ¥15 【求职】怎么找到一个周围人素质都很高不会欺负他人,并且未来月薪能够达到一万以上(技术岗)的工作?希望可以收到写有具体,可靠,已经实践过了的路径的回答?