简体   繁体   English

使用jax-ws初始化Web服务时发生异常

[英]Exception while initializing webservice using jax-ws

can any one please tell me what the problem is i am trying to create a new web service client in my client side project which already has a web service client i cant seem to figure out what is wrong 谁能告诉我问题是什么,我正在尝试在我的客户端项目中创建一个新的Web服务客户端,该客户端项目已经有一个Web服务客户端,我似乎无法弄清楚出什么问题了

Exceptions details : null java.lang.NullPointerException at java.io.File.(File.java:222) at org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:505) at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:165) at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:100) at org.glassfish.webservices.JAXWSServlet.doGet(JAXWSServlet.java:195) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.j 异常详细信息:org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:505)处java.io.File。(File.java:222)处的null java.lang.NullPointerException org.glassfish.webservices.monitoring处的异常org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:100)位于org.glassfish.webservices.JAXWSServlet.doGet(JAXWSServlet.java:195)处的.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:165)。 org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)上的javax.servlet.http.HttpServlet.service(HttpServlet.java:847)上的servlet.http.HttpServlet.service(HttpServlet.java:734)在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)在org.apache.catalina.core.StandardPipeline.invoke (StandardPipeline.java:641),位于com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.j ava:97) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) ava:97)位于com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)位于org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)位于org.apache.catalina.connector org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)上的.CoyoteAdapter.doService(CoyoteAdapter.java:325)在com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java) :165),位于com.sun.grizzly.http。 com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)处的ProcessorTask.process(ProcessorTask.java:954)com.sun.com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)处的ProcessorTask.process(ProcessorTask.java:954) .grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)位于com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:619) 在com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)在com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)在com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java :57)在com.sun.grizzly.ContextTask.run(ContextTask.java:69)在com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:330)在com.sun.grizzly.util。 java.lang.Thread.run(Thread.java:619)上的AbstractThreadPool $ Worker.run(AbstractThreadPool.java:309)

I got the same problem, when I tried to test the web service not from localhost ( localhost:8080/WebService?Tester ) but from IP-address ( 192.168.10.11:8080/WebService?Tester for example). 当我尝试不是从localhost( localhost:8080/WebService?Tester )而是从IP地址 (例如192.168.10.11:8080/WebService?Tester )测试Web服务时,我遇到了同样的问题。 Browser yielded the exception above while GlassFish 3 console wrote something like this: 当GlassFish 3控制台编写如下内容时,浏览器产生了上述异常:

INFO: [ERROR] Server returned HTTP response code: 407 for URL: h ttp://xxx,xxx,xxx,xxx:8080/WebService?WSDL

Failed to read the WSDL document: http://xxx,xxx,xxx,xxx:8080/WebService?WSDL , because 无法读取WSDL文档: http://xxx,xxx,xxx,xxx:8080/WebService?WSDL ,因为

1.could not find the document. 1.找不到文件。

2.the document could not be read. 2.无法读取文件。

3.the root element of the document is not . 3.文档的根元素不是。

INFO: [ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s): 
 At least one WSDL with at least one service definition needs to be provided.<br>
INFO:         Failed to parse the WSDL.
INFO: Invoking wsimport with h ttp://xxx,xxx,xxx,xxx:8080/WebService?WSDL<br>
SEVERE: wsimport failed

I use a proxy-server for Internet access, so I thought it might be the reason. 我使用代理服务器访问Internet,所以我认为可能是原因。

Then I went to the GlassFish 3 server properties in IDE (NetBeans, in my case) and switched off the option " Use IDE proxy settings ". 然后,转到IDE(在我的情况下为NetBeans)中的GlassFish 3服务器属性,然后关闭“ 使用IDE代理设置 ”选项。 The problem was solved by then. 到那时问题就解决了。

Hope it can help. 希望能有所帮助。

This looks like issue GLASSFISH-14391 . 这看起来像问题GLASSFISH-14391 If not, try searching JIRA with your Glassfish version number and problem details. 如果不是,请尝试使用您的Glassfish版本号和问题详细信息搜索JIRA

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM