0

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)

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

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

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).

Any suggestion is welcome.

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

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

Community
  • 1
  • 1
ZiglioUK
  • 2,573
  • 4
  • 27
  • 32

1 Answers1

0

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.

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.

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!

ZiglioUK
  • 2,573
  • 4
  • 27
  • 32