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
- xml-apis-1.0.b2,=.jar
- jaxb-api.jar
- 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.