GAE + JAXWS bug

378 views
Skip to first unread message

Deepak Singh

unread,
Sep 16, 2011, 3:05:45 PM9/16/11
to google-a...@googlegroups.com
Hi,

I am using JAXWS 2.1  client on GAE 1.5.4 and gets the following exception.

com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection <init>: Unable to make javax.xml.ws.wsaddressing.W3CEndpointReference.address accessible.
java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address
	at com.google.appengine.runtime.Request.process-8eeeb314523d0639(Request.java)
	at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.<init>(Accessor.java:220)
	at com.sun.xml.bind.AccessorFactoryImpl.createFieldAccessor(AccessorFactoryImpl.java:66)
	at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.createFieldSeed(RuntimeClassInfoImpl.java:252)
	at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.createFieldSeed(RuntimeClassInfoImpl.java:81)
	at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findFieldProperties(ClassInfoImpl.java:398)
	at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:301)
	at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:176)
	at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:243)
	at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:100)
	at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
	at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:209)
	at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:95)
	at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
	at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:315)
	at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:330)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:441)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:288)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1111)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:233)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:410)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:594)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:542)
	at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)
	at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
	at java.security.AccessController.doPrivileged(AccessController.java:34)
	at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
	at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:88)
	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)
	at javax.xml.ws.Service.<init>(Service.java:76)
	at ws.ticketvala.WSTicketvala.<init>(WSTicketvala.java:46)
	at com.faregugly.server.SpringServiceImpl.afterPropertiesSet(SpringServiceImpl.java:817)
	at 

Caused by: java.lang.IllegalAccessException: Reflection is not allowed on private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address
	... 74 more

Can you pls look into this issue ?

Deepak

Deepak Singh

unread,
Sep 17, 2011, 12:28:07 PM9/17/11
to google-a...@googlegroups.com
I reported a production issue 5927.

ZM

unread,
Nov 18, 2011, 9:56:32 AM11/18/11
to google-a...@googlegroups.com
Exactly same thing here, working on local dev environment, after upload got same exception,

Deepak Singh

unread,
Nov 19, 2011, 4:51:13 PM11/19/11
to google-a...@googlegroups.com
I believe GAE team has stopped resolving bug. So make sure we need to cooperate with this.

Thanks to GAE for not commenting this issue.

Regards
Deepak

On Fri, Nov 18, 2011 at 8:26 PM, ZM <dr.muzo...@gmail.com> wrote:
Exactly same thing here, working on local dev environment, after upload got same exception,

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/u13-NkJ7SUUJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Deepak Singh

Phil

unread,
Sep 19, 2012, 6:11:15 AM9/19/12
to google-a...@googlegroups.com
Any advices for fixing this issue because I  got the same problem when I deploy my application on google server. It works fine in local developement.

Thanks for your feedback

Emanuele Ziglioli

unread,
Sep 19, 2012, 7:55:46 AM9/19/12
to google-a...@googlegroups.com
Have you got a jaxb jar in your classpath?
If that's the case, you have to remove it and rely on the JRE implementation of jaxb.
The GAE runtime wants you to use their jaxb and jaxws implementations.
You can use a jaxb jar without jaxws but not toghether (the reason escapes me).
I had to adapt my code (and the restlet jaxb adaptor) to do so.

Phil

unread,
Sep 19, 2012, 8:03:37 AM9/19/12
to google-a...@googlegroups.com
Thanks for your quick answer. However, I haven't any jaxb on my classpath. I use the one of app engine.
Any other advices?

Many thanks for your help, I really need to fix this issue.

Emanuele Ziglioli

unread,
Sep 19, 2012, 8:53:28 AM9/19/12
to google-a...@googlegroups.com
Start from their basic SOAP tutorial and add your project jars one by one, that's what I did...
In my case just the presence of a jaxb jar was enough to screw things up.
But my case was just one possibility, there could be other classes triggering this problem. GAE's security manager is very strict (probably a good thing)

Emanuele Ziglioli

unread,
Sep 19, 2012, 8:57:58 AM9/19/12
to google-a...@googlegroups.com
By the way, I've also managed to get the Force.com SOAP implementation running on GAE, it's older than their implementation but pehaps faster and I can also set timeouts. It relies on top of URLfetch:


Their code generator is a bit buggy 


On Thursday, 20 September 2012 00:03:37 UTC+12, Phil wrote:

Phil

unread,
Sep 19, 2012, 9:07:57 AM9/19/12
to google-a...@googlegroups.com
I already add one by one some packages on the basic projects..Without success.

Do you mean that I can add Force.com SOAP as plugin into my app engine Project? If I understand, my app engine project could call a Web service by using Force.com SOAP?

Emanuele Ziglioli

unread,
Sep 19, 2012, 9:14:18 AM9/19/12
to google-a...@googlegroups.com


On Thursday, 20 September 2012 01:07:57 UTC+12, Phil wrote:
I already add one by one some packages on the basic projects..Without success.

do you mean that you didn't manage to reproduce the problem on the production server?
so you're saying that the SOAP tutorial works with all the jars from your project but your project doesn't, is that what you mean?
 

Do you mean that I can add Force.com SOAP as plugin into my app engine Project? If I understand, my app engine project could call a Web service by using Force.com SOAP?

yes, you can use their implementation (that is not jax-ws compliant) instead. That's what I did when I got desperate. 
Their code generator didn't work 100% well with our schema but I managed to fix the generated code somehow.
 

Phil

unread,
Sep 19, 2012, 9:20:13 AM9/19/12
to google-a...@googlegroups.com
I mean that I create a web application project from Eclipse, then add my code for calling the webservice. When I run in local, It works however on server I got the above exception. But I didn't add any of my jar in the projet. I only use the one of Google App Enfin.

Could you tell me where is the tutorial SOAP that you're talking about?

Phil

unread,
Sep 19, 2012, 9:35:41 AM9/19/12
to google-a...@googlegroups.com
I tried Force.com API. Unfortunetly, when I generate code from WSDL, I got the error message : Found more than one wsdl:binding. WSDL with multiple binding not supported

I guest that the WSDL won't work with Force.com?

Emanuele Ziglioli

unread,
Sep 19, 2012, 9:40:04 AM9/19/12
to google-a...@googlegroups.com


On Thursday, 20 September 2012 01:20:13 UTC+12, Phil wrote:
I mean that I create a web application project from Eclipse, then add my code for calling the webservice. When I run in local, It works however on server I got the above exception. But I didn't add any of my jar in the projet. I only use the one of Google App Enfin.

yes, you will get the exception on the production server because their security manager is more strict and their runtime is different.
Often I get exceptions on production only when reflection is involved
 

Could you tell me where is the tutorial SOAP that you're talking about?

That will certainly work on the GAE server on a new project. Try your own WSDL 

Emanuele Ziglioli

unread,
Sep 19, 2012, 9:42:20 AM9/19/12
to google-a...@googlegroups.com


On Thursday, 20 September 2012 01:35:41 UTC+12, Phil wrote:
I tried Force.com API. Unfortunetly, when I generate code from WSDL, I got the error message : Found more than one wsdl:binding. WSDL with multiple binding not supported
 
I guest that the WSDL won't work with Force.com?


I did get an error too and I googled. Can't remember what I did. I didn't get rid of the error but most code I need had been generated.
You'll see that the code generated by their library is way simpler than jax-ws complient code. 
You could almost take an existing example and adapt it to your schema if it's small enough

Emanuele Ziglioli

unread,
Sep 19, 2012, 9:43:06 AM9/19/12
to google-a...@googlegroups.com
I'm going to bed now (almost 2am NZ time). Good luck!


On Thursday, 20 September 2012 01:35:41 UTC+12, Phil wrote:

Phil

unread,
Sep 19, 2012, 9:48:44 AM9/19/12
to google-a...@googlegroups.com
Thanks for your help. Good night
Reply all
Reply to author
Forward
Message has been deleted
0 new messages