JBoss AS7:Web 服务连接被拒绝
我在 JBOSS AS7 上使用 ProcessBuilder 来运行外部 JAR,然后调用 Endpoint.publish() 来创建 JAX-WS Web 服务。之后我将使用 Stateful bean 来访问 Web 服务。
服务本身运行良好,我通过 wsimport 导入了 WS 客户端代理类,并且可以通过浏览器或soapUI 访问 WSDL。 但是当我尝试访问服务器上的Web服务时,JBOSS输出“连接被拒绝”。我什至尝试了调试模式,但没有收集任何有用的消息。
我已经禁用了防火墙,但没有骰子:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:4045/WebService/WebMethod?WSDL'.: java.net.ConnectException: Connection refused: connect
系统:JBOSS AS7.1.0.Alpha2,Windows,本地主机
jboss日志:
08:26:01,572 ERROR [stderr] (http--127.0.0.1-8080-1) javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
08:26:01,573 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
08:26:01,574 ERROR [stderr] (http--127.0.0.1-8080-1) at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:141)
08:26:01,574 ERROR [stderr] (http--127.0.0.1-8080-1) at javax.xml.ws.Service.<init>(Service.java:57)
...
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) ... 158 more
08:26:01,604 ERROR [stderr] (http--127.0.0.1-8080-1) Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:4045/WebService/WebMethod?WSDL'.: java.net.ConnectException: Connection refused: connect
08:26:01,604 ERROR [stderr] (http--127.0.0.1-8080-1) at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:239)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) ... 160 more
08:26:01,606 ERROR [stderr] (http--127.0.0.1-8080-1) Caused by: java.net.ConnectException: Connection refused: connect
...
I am using ProcessBuilder on JBOSS AS7 to run an external JAR which then calls Endpoint.publish() to create a JAX-WS Web Service. I am using a Stateful bean to access the Web Service afterwards.
The service itself runs fine, I imported the WS-client proxy classes via wsimport and I can access the WSDL via browser or soapUI.
But when I try to access the Web service on the server, JBOSS outputs "connection refused". I even tried Debug mode but without gathering any useful messages.
I already disabled the firewall but no dice:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:4045/WebService/WebMethod?WSDL'.: java.net.ConnectException: Connection refused: connect
System: JBOSS AS7.1.0.Alpha2, Windows, localhost
jboss log:
08:26:01,572 ERROR [stderr] (http--127.0.0.1-8080-1) javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
08:26:01,573 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
08:26:01,574 ERROR [stderr] (http--127.0.0.1-8080-1) at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:141)
08:26:01,574 ERROR [stderr] (http--127.0.0.1-8080-1) at javax.xml.ws.Service.<init>(Service.java:57)
...
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
08:26:01,603 ERROR [stderr] (http--127.0.0.1-8080-1) ... 158 more
08:26:01,604 ERROR [stderr] (http--127.0.0.1-8080-1) Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:4045/WebService/WebMethod?WSDL'.: java.net.ConnectException: Connection refused: connect
08:26:01,604 ERROR [stderr] (http--127.0.0.1-8080-1) at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:239)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
08:26:01,605 ERROR [stderr] (http--127.0.0.1-8080-1) ... 160 more
08:26:01,606 ERROR [stderr] (http--127.0.0.1-8080-1) Caused by: java.net.ConnectException: Connection refused: connect
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试通过在文件 run.bat 中添加属性 -b 0.0.0.0 来运行 Jboss 服务器,如下所示:
Try to run Jboss server by adding the property -b 0.0.0.0 in the file run.bat like follows:
请参阅 Stephen84s 的回答:
并且来自相同的源
您提到您关闭了防火墙。那么,你的端口一定错误。
尝试以本地主机身份运行您的软件,例如端口 4000:
Please see Stephen84s' answer:
and from the same source
You mentioned that you turned the firewall off. Then, you must have the port wrong.
Try to run your software as localhost, for instance to the port 4000: