任务: 我正在使用WAS运行时在企业环境中开发J2EE应用程序。我必须使用组织已经开发的JAX-WS Web服务,并且我只提供了一个wsdl来继续。所以为了测试我创建了一个项目的服务;将wsdl复制到其中然后生成客户端。然后我的项目填充了一堆java类。我测试了服务,成功编写了一个主类并调用了服务端点。
问题: 现在,当我尝试在已经存在的Web项目中调用此Web服务时,将Iwe存储库中提供的webservice jar包含在类路径中,然后我无法运行相同的服务而是获得异常:< / p>
javax.xml.ws.WebServiceException: javax.wsdl.WSDLException: WSDLException
(at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to
determine namespace of 'tns:getUserResponse'
调试后,我发现在使用URL和QName创建Service实例时发生错误:
Service#create(URL wsdlDocumentLocation, QName serviceName)
它被捕获到WebServiceException类中。
研究:
我试过搜索类似的错误消息,但只发现了我不完全理解的评论:
This problem occurs when the thrown exception is in a different package from the service interface, and the exception is not in java.lang.* or in javax.*. When all of these apply, the WSDL generated by Axis2 1.2 refers to an undefined namespace prefix.
我正在寻找“那里做过那种”经验丰富的人的回复。我知道这个问题太局部化了。
PS: wsdl没有任何问题;组织中的其他应用程序正在使用它。
完整堆栈跟踪:
javax.xml.ws.WebServiceException: javax.wsdl.WSDLException: WSDLException(at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getUserResponse'.
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
org.apache.axis2.jaxws.util.WSDL4JWrapper.loadDefinition(WSDL4JWrapper.java:741)
org.apache.axis2.jaxws.util.WSDL4JWrapper.getDefinition(WSDL4JWrapper.java:657)
org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:224)
org.apache.axis2.jaxws.util.WSDL4JWrapper.<init>(WSDL4JWrapper.java:156)
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinitionServiceDescriptionImpl.java:1182)
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:249)
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:172)
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:143)
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79)
org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:78)
org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:218)
org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:83)
org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:79)
javax.xml.ws.Service.<init>(Service.java:57)
javax.xml.ws.Service.create(Service.java:687)
com.myexample.project.security.servlet.MyAdapter.authenticateUser(MyAdapter.java:39)
com.myexample.project.security.servlet.AbstractLoginServlet.doLogin(AbstractLoginServlet.java:244)
com.myexample.project.security.servlet.AbstractLoginServlet.doPost(AbstractLoginServlet.java:341)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1027)
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703)
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:522)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:311)
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:282)
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)
Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part):faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getUserResponse'.
com.ibm.wsdl.util.xml.DOMUtils.getQName(DOMUtils.java:309)
com.ibm.wsdl.util.xml.DOMUtils.getQualifiedAttributeValue(DOMUtils.java:367)
com.ibm.wsdl.xml.WSDLReaderImpl.getQualifiedAttributeValue(WSDLReaderImpl.java:2146)
com.ibm.wsdl.xml.WSDLReaderImpl.parsePart(WSDLReaderImpl.java:1345)
com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1324)
com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:357)
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2409)
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2373)
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2426)
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2334)
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2296)
org.apache.axis2.jaxws.util.WSDL4JWrapper$13.run(WSDL4JWrapper.java:732)
org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)
org.apache.axis2.jaxws.util.WSDL4JWrapper.loadDefinition(WSDL4JWrapper.java:729)
... 43 more
答案 0 :(得分:0)
我有很多错误需要解决。我错过了将客户端jar文件放入我使用Web服务的项目中,然后我需要使用WAS管理控制台指定JVM parameters
。我把它放在了错误的地方。
-Djavax.net.ssl.trustStore=C:\IBM\RAD85\jdk\jre\lib\security\cacerts
-Djavax.net.ssl.trustStorePassword=changeit