我正在使用一些实际上是Web服务客户端的第三方代码。当我在JDK甚至Tomcat
上运行它时,它工作正常。但是,只要我将其集成到我的Web项目中用于weblogic
服务器的生产阶段,它就会因错误FileNotFoundException
而异常行动,而我无法解决。
据我所知,Tomcat
用于开发阶段,因此有点宽松,这就是我之前没有遇到任何问题的原因。但weblogic
以自己的方式增加了限制。
如果我无法在weblogic
上运行该Web服务客户端,我需要将这段代码保留在生产服务器环境之外并在简单的JDK上运行它。现在要访问这个外部代码,我应该使用Remote Method Invocation
还是有更简单的解决方案?我只是通过用WEBSERVICEURL
替换实际的URL来添加完整的堆栈跟踪。希望这不会影响答案。
Exception in thread "Timer-5" javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://cert.hub.care360.com/orders/submission/service?wsdl. It failed with:
Response: '401: Unauthorized' for url: 'WEBSERVICEURL'.
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:172)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:153)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:273)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:236)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:184)
at weblogic.wsee.jaxws.spi.WLSServiceDelegate.<init>(WLSServiceDelegate.java:42)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:206)
at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:57)
at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:41)
at javax.xml.ws.Service.<init>(Service.java:56)
at com.medplus.orders.OrderSubmissionService.<init>(OrderSubmissionService.java:42)
at com.adamsoft.edoc.util.QuestOrderService.sendOrder(QuestOrderService.java:137)
at com.adamsoft.edoc.util.QuestOrderService.run(QuestOrderService.java:308)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.io.FileNotFoundException: Response: '401: Unauthorized' for url: 'WEBSERVICEURL'
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:474)
at weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37)
at java.net.URL.openStream(URL.java:1010)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:843)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:289)
at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:138)
at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:273)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:237)
at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:187)
at weblogic.wsee.jaxws.spi.WLSServiceDelegate.<init>(WLSServiceDelegate.java:36)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:207)
at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:57)
at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:41)
at javax.xml.ws.Service.<init>(Service.java:56)
at com.medplus.orders.OrderSubmissionService.<init>(OrderSubmissionService.java:43)
at com.adamsoft.edoc.util.QuestOrderService.sendOrder(QuestOrderService.java:137)
at com.adamsoft.edoc.util.QuestOrderService.run(QuestOrderService.java:310)
... 2 more