Hi

thanks for your post.
At the moment. the default providers are preinstantiated, the Aegis one you
registered will be chosen before the default one...
Ideally, the default providers would be created on teh demand but it would
introduce its own complexity (synchronization, etc)...
Not sure yet how to deal with this issue. Is it really the fact that JAXB
classes are referenced from the JAXB provider that causes this
SecurityException ?

thanks, Sergey


Vinicius Carvalho wrote:
> 
> Hello there! I'm trying to get CXF working on Appengine, but I could
> not found a way. I just need to user JAX-RS, and since AppEngine does
> not support JAXB I'm using it without any JAXB jars or references.
> Here's my beans.xml:
> 
> <jaxrs:server id="locationService" address="/location">
>       <jaxrs:serviceBeans>
>               <ref bean="myService"/>
>       </jaxrs:serviceBeans>
> 
>       <jaxrs:providers>
>           <bean class="org.apache.cxf.jaxrs.provider.AegisElementProvider"/>
>               <bean class="org.apache.cxf.jaxrs.provider.AegisJSONProvider"/>
>       </jaxrs:providers>
>   </jaxrs:server>
> 
> I've also modified cxf.xml removing:
> 
>   <bean id="org.apache.cxf.wsdl.WSDLManager"
> class="org.apache.cxf.wsdl11.WSDLManagerImpl">
>         <property name="bus" ref="cxf"/>
>     </bean>
> 
> <bean id="org.apache.cxf.transports.http.QueryHandlerRegistry"
> class="org.apache.cxf.transport.http.QueryHandlerRegistryImpl">
>         <property name="bus" ref="cxf"/>
>         <property name="queryHandlers">
>               <list>
>                       <bean 
> class="org.apache.cxf.transport.http.WSDLQueryHandler">
>                               <property name="bus" ref="cxf"/>
>                       </bean> 
>               </list>
>         </property>
>     </bean>
> 
> Since those seemed to be using jaxb classes.
> 
> Well, after deploying this modified version of CXF I still get this error:
> 
> org.springframework.web.context.ContextLoader
> initWebApplicationContext: Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'locationService': Invocation of init method
> failed; nested exception is java.lang.ExceptionInInitializerError
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>       at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>       at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
>       at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
>       at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
>       at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
>       at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
>       at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
>       at
> org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)
>       at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
>       at
> org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
>       at
> org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
>       at 
> org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
>       at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>       at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191)
>       at
> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168)
>       at
> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:127)
>       at
> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
>       at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
>       at
> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
>       at
> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>       at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
>       at com.google.net.rpc.impl.Server$2.run(Server.java:814)
>       at
> com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56)
>       at
> com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516)
>       at com.google.net.rpc.impl.Server.startRpc(Server.java:769)
>       at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
>       at
> com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:437)
>       at
> com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319)
>       at
> com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290)
>       at com.google.net.async.Connection.handleReadEvent(Connection.java:436)
>       at
> com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:762)
>       at
> com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
>       at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:101)
>       at
> com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251)
>       at
> com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:396)
>       at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.ExceptionInInitializerError
>       at
> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setupFactory(AbstractJAXRSFactoryBean.java:231)
>       at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:96)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Method.java:40)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1413)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
>       ... 44 more
> Caused by: java.lang.SecurityException: Unable to get members for
> class org.apache.cxf.jaxrs.provider.JAXBElementProvider
>       at
> com.google.appengine.runtime.Request.process-8835d92e4daee7d0(Request.java)
>       at java.lang.Class.getMethods(Class.java:180)
>       at
> org.apache.cxf.jaxrs.model.AbstractResourceInfo.initContextSetterMethods(AbstractResourceInfo.java:113)
>       at
> org.apache.cxf.jaxrs.model.AbstractResourceInfo.<init>(AbstractResourceInfo.java:61)
>       at org.apache.cxf.jaxrs.model.ProviderInfo.<init>(ProviderInfo.java:27)
>       at
> org.apache.cxf.jaxrs.provider.ProviderFactory.setProviders(ProviderFactory.java:298)
>       at
> org.apache.cxf.jaxrs.provider.ProviderFactory.<clinit>(ProviderFactory.java:73)
>       ... 53 more
> 
> 
> Why is JAXBElementProvider still being loaded if I am using
> AegisElementProvider?
> 
> Regards
> 
> 

-- 
View this message in context: 
http://www.nabble.com/CXF-on-AppEngine-tp25884251p25895965.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to