JBoss AS7:Web 服务连接被拒绝

发布于 2024-12-12 01:50:36 字数 3000 浏览 0 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请爱~陌生人 2024-12-19 01:50:36

尝试通过在文件 run.bat 中添加属性 -b 0.0.0.0 来运行 Jboss 服务器,如下所示:

standalone.bat -b 0.0.0.0

Try to run Jboss server by adding the property -b 0.0.0.0 in the file run.bat like follows:

standalone.bat -b 0.0.0.0
我不是你的备胎 2024-12-19 01:50:36

请参阅 Stephen84s 的回答:

您的系统上需要运行一个 echo 服务器,该服务器由
大多数 UNIX 机器并在端口 7 上运行。

并且来自相同的源

要检查您的 Vista 机器是否正在运行,只需点击 telnet localhost 7
,如果显示连接被拒绝或无法连接,则表示
你的盒子没有回显服务器,因此你的程序不会
工作,这就是我对你的 ConnectException 异常有感觉的原因。

您提到您关闭了防火墙。那么,你的端口一定错误
尝试以本地主机身份运行您的软件,例如端口 4000:

echoSocket = new Socket("localhost", 4000);

Please see Stephen84s' answer:

You need an echo server running on your system, which is provided by
most UNIX machines and runs on port no 7.

and from the same source

To check if your Vista box has one running just hit telnet localhost 7
, if it shows connection refused or could not connect, then it means
you box does not have an echo server, and hence your program will not
work and thats the reason I feel for your ConnectException exception.

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:

echoSocket = new Socket("localhost", 4000);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文