javax.xml.ws.Service 构造函数不返回

发布于 2024-11-18 06:49:20 字数 890 浏览 1 评论 0原文

我在部署定期调用 Web 服务的 Glassfish Web 应用程序时遇到问题。基本上问题似乎是对 javax.xml.ws.Service 的调用似乎永远不会返回。没有抛出异常。

代码如下所示(对象/变量名称已更改):

  MyService ss = new MyService(wsdlURL, SERVICE_NAME);

其中 wsdlURL 是本地 WSDL 文件的 URL 对象(也尝试使用远程托管 WSDL),SERVICE_NAME 是带有 Web 服务名称的字符串。

MyService 对象的实际构造函数只是在 javax.xml.ws.Service 上调用 super

public class MyService extends Service {
    public MyService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }
}

在我的开发机器上,这完全按照预期工作,但在部署中调用 MyService 构造函数永远不会返回。

我尝试将其部署在运行 Red Hat Enterprise Linux Server 5.6 (Tikanga) 的 Glassfish v3.1 服务器上。

开发和部署环境上的 Java 版本均为 1.6。

有人对这里可能发生的事情有任何想法吗?缺乏任何异常使得调试非常困难。我想这可能是一个 WSDL 问题,就好像我理解正确一样,javax.xml.ws.Service 在调用构造函数期间做了一些解释,我认为这可能会导致某些内容挂起。然而,这似乎很奇怪,它在我的开发机器上工作正常,但在部署服务器上却不行。

非常感谢任何帮助!

I'm having a problem deploying a Glassfish web application which calls a web service periodically. Basically the issue seems to be that the call to the javax.xml.ws.Service never seems to return. There are no exceptions thrown.

The code looks as follows (object / variable names changed):

  MyService ss = new MyService(wsdlURL, SERVICE_NAME);

where wsdlURL is a URL object for a local WSDL file (have also tried with a remotely hosted WSDL), and SERVICE_NAME is the string with the web service name.

The actual constructor for the MyService object simply invokes super on javax.xml.ws.Service

public class MyService extends Service {
    public MyService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }
}

On my development machine this works exactly as expected, but in deployment the call to the
MyService constructor never returns.

I am attempting to deploy this on a Glassfish v3.1 server running on a Red Hat Enterprise Linux Server release 5.6 (Tikanga).

Java version is 1.6 on both development and deployment environments.

Does anybody have any ideas about what could be happening here? The lack of any exceptions makes this very difficult to debug. I imagine that this could potentially be a WSDL problem as if I understand it correctly, javax.xml.ws.Service does some interpretation during the call to the constructor, which I suppose could be causing something to hang. However, it seems very odd that it would work fine on my development machine, but not on the deployment server.

Any help is much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

孤芳又自赏 2024-11-25 06:49:20

该问题可能是由于部署计算机上使用的代理造成的。
我也遇到过同样的问题,后来发现这是由于代理设置造成的。

尝试在创建 Stub 类之前设置代理,即

 System.setProperty("http.proxyHost", "xxx.x.xx.xx");
 System.setProperty("http.proxyPort", "8080");
 MyService ss = new MyService(wsdlURL, SERVICE_NAME);

The problem might be because of proxy that is being used on deployment machine.
I had faced the same problem and later figured out that it is due to the proxy settings.

Try setting proxy before creating the Stub class, i.e

 System.setProperty("http.proxyHost", "xxx.x.xx.xx");
 System.setProperty("http.proxyPort", "8080");
 MyService ss = new MyService(wsdlURL, SERVICE_NAME);
ヤ经典坏疍 2024-11-25 06:49:20

我有类似的经历,这是因为给定的 URL 无效。

I had a similar experience and it was because the given URL was not valid.

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