App Engine上初始化javax.xml.ws.Service时出错 [英] Error in javax.xml.ws.Service initialization on App Engine

查看:204
本文介绍了App Engine上初始化javax.xml.ws.Service时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从GAE连接到SOAP服务器。请参阅示例
它在开发服务器上工作正常,但在生产过程中,初始化过程中出现500错误。经过大量的挖掘,我设法捕获一个Throwable并记录一个堆栈跟踪:

I'm trying to connect to a SOAP server from GAE. See example. It all works fine on the development server but on production I get a 500 error during initialization. After a lot of digging, I managed to catch a Throwable and log a stack trace:

java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:58)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:142)
at javax.xml.ws.spi.Provider.provider(Provider.java:102)

这个问题可能与 Issue 4910 。有一个建议表示:

This problem may be related to Issue 4910. One suggestion there says:


我上面的意思是,你不应该把任何jar文件
实现jaxws本身到你的战争中。 App Engine运行时
包含一个jaxws实现,您应该使用它。

What I meant above is that you should not put any jar files implementing jaxws itself into your war. The App Engine runtime contains an implementation of jaxws and you should use that one.

在我的类路径中,我找到了

In my classpath I've found


  1. xml-apis-1.0.b2,=。jar

  2. jaxb-api.jar

  3. jaxb-impl.jar

它们看起来不像jaxws实现,至少据我所理解。如果没有jaxb,我真的无法做到这一点(如果我删除那个jar,我会得到一个错误)。

They don't look like jaxws implementations, well at least as far as I understand. Can't really do without jaxb (I get an error if I remove that jar).

欢迎任何建议。

[update]
[看来] 3 ,在类路径中只有jaxb会导致问题,以至于无法找到GAE的jaxws实现。

[update] [It seems]3 that just having jaxb in the classpath causes a problem so that GAE's jaxws implementation cannot be found.

对于理解jaxws初始化的工作方式也很有用。

This answer is also useful to understand how jaxws initialzation works.

推荐答案

经过大量的挖掘,我放弃了GAE的jaxws实现。
它们的实现不能由Factory classloader,period找到。

After a lot of digging I've given up on GAE's implementation of jaxws. Their implementation can't be found by the Factory classloader, period.

所以我选择了 Force.com Web Services Connecto r,并设法使其工作。
在代码生成过程中,在生成的代码中存在一些错误,并且GAE连接器也需要一些修复。

So I've picked the Force.com Web Services Connector and managed to make it work. There were bugs in the code generation process, in the generated code, and also the GAE connector needed some fixes.

我很想创建一个项目在GitHub上展示我所做的。
这个实现更快,您也可以设置套接字超时!

I'm tempted to created a project on GitHub to show what I've done. This implementation is faster and also you can set the socket timeout!

这篇关于App Engine上初始化javax.xml.ws.Service时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆