users@jersey.java.net

Re: [Jersey] Issue with SpringServlet - XMLRootElementProvider InstantiationException

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Sat, 16 May 2009 09:57:39 +0200

Hi Peter,

Note that for later releases the maven spring artifacts were moved to
the com.sun.jersey.contribs area.

Please look at the dependencies document for more details:

   https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.1.0-ea/jersey/dependencies.html

Also look at the Spring sample:

   http://download.java.net/maven/2/com/sun/jersey/samples/spring-annotations/1.1.0-ea/spring-annotations-1.1.0-ea-project.zip


It has been a while since 1.0 :-) but IIRC if a component could not be
loaded then Jersey would log the reason why but it would not stop the
application from deploying, for example in your case i am guessing it
is because JAXB is not in your classpath and the JAXB components will
not be loaded. For later releases i moved the logging to the config
level.

Paul.

On May 16, 2009, at 1:29 AM, Peter Coppens wrote:

>
> Dear Jersey fans
>
> I have a setup using Jersey 1.0 and the spring servlet 1.0. I have
> e custom
> messagebodywriter and also 2 filters (request and response)
>
> While the application seems to be working I always get the stack
> lower in
> this post.
>
> I also tried to switch to jersey 1.1.0 or 1.1.1 but apparently the
> SpringServlet is not working there (tried to compile from the
> sources but
> lots of compilation errors popped up. I guess because the servlet
> code is
> not up to the 1.1.x level.
>
> So two questions
>
> - Any guidance on the exception with 1.0?
> - Any guidance on upgrading the SpringServlet to be compatible with
> 1.1.x
> release of jersey?
>
> Many thanks!
>
> Peter
>
>
> java.lang.InstantiationException:
> com.sun.jersey.impl.provider.entity.XMLRootElementProvider
> at java.lang.Class.newInstance0(Class.java:335)
> at java.lang.Class.newInstance(Class.java:303)
> at
> com.sun.jersey.impl.application.WebApplicationImpl
> $AdaptingComponentProvider.getInstance(WebApplicationImpl.java:334)
> at
> com
> .sun
> .jersey
> .impl
> .application
> .ComponentProviderCache.getComponent(ComponentProviderCache.java:179)
> at
> com
> .sun
> .jersey
> .impl
> .application
> .ComponentProviderCache
> .getProvidersAndServices(ComponentProviderCache.java:122)
> at
> com
> .sun
> .jersey
> .impl
> .application
> .MessageBodyFactory.getProviderMap(MessageBodyFactory.java:133)
> at
> com
> .sun
> .jersey
> .impl
> .application.MessageBodyFactory.initReaders(MessageBodyFactory.java:
> 107)
> at
> com
> .sun
> .jersey
> .impl.application.MessageBodyFactory.init(MessageBodyFactory.java:102)
> at
> com
> .sun
> .jersey
> .impl
> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:642)
> at
> com
> .sun
> .jersey
> .spi
> .spring.container.servlet.SpringServlet.initiate(SpringServlet.java:
> 66)
> at
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.load(ServletContainer.java:
> 538)
> at
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 197)
> at
> org
> .apache
> .catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
> at
> org
> .apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:
> 808)
> at
> org
> .apache
> .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
> 129)
> at
> org
> .apache
> .catalina.core.StandardContextValve.invoke(StandardContextValve.java:
> 191)
> at
> org
> .apache
> .catalina
> .authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
> at
> org
> .apache
> .catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> at
> org
> .apache
> .catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org
> .apache
> .catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
> 109)
> at
> org
> .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> 286)
> at
> org
> .apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 845)
> at
> org.apache.coyote.http11.Http11Protocol
> $Http11ConnectionHandler.process(Http11Protocol.java:583)
> at org.apache.tomcat.util.net.JIoEndpoint
> $Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:613)
> --
> View this message in context: http://n2.nabble.com/Issue-with-SpringServlet---XMLRootElementProvider-InstantiationException-tp2910480p2910480.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>