App Engine上的javax.xml.ws.Service初始化出错

时间:2012-07-25 05:21:28

标签: java web-services google-app-engine soap jax-ws

我正在尝试从GAE连接到SOAP服务器。见example。 这一切在开发服务器上工作正常但在生产时我在初始化期间得到500错误。经过大量挖掘后,我设法捕获了一个Throwable并记录了堆栈跟踪:

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有关。有一个建议说:

  

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

在我的课程路径中,我找到了

  1. XML的API-1.0.b2,=。罐子
  2. JAXB-api.jar文件
  3. JAXB-impl.jar中
  4. 它们看起来不像jaxws实现,至少据我所知。没有jaxb真的没有(如果我删除那个罐子我会收到错误)。

    欢迎提出任何建议。

    [更新] [似乎] 3只是在类路径中使用jaxb会导致问题,因此无法找到GAE的jaxws实现。

    This answer对了解jaxws初始化的工作原理也很有用。

1 个答案:

答案 0 :(得分:0)

经过大量挖掘后,我放弃了GAE对jaxws的实施。 Factory classloader,period。无法找到它们的实现。

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

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