users@jersey.java.net

Re: [Jersey] A message body writer for Java type [] and MIME media type, application/xml, was not found

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 17 Feb 2009 11:51:42 +0100

Hi Mukesh,

The error indicates that JAXB is not present in the class path.

Is there any other logging information when deploying the app to
indicate any issue?

Can you send the directory contents of your WEB-INF/lib directory?

Thanks,
Paul.

On Feb 16, 2009, at 11:48 PM, Singhania, Mukesh wrote:

> I am trying to deploy and test the jaxb
> (com.sun.jersey.samples.jaxb.JAXBResource) service which comes with
> the Jersey samples on Tomcat.
>
> when i try to access resource : /jaxb/XmlRootElement
>
> I get this error:
>
>
> Feb 16, 2009 5:44:37 PM
> com.sun.jersey.spi.container.ContainerResponse write
> SEVERE: A message body writer for Java type, class
> com.sun.jersey.samples.jaxb.JAXBXmlRootElement, and MIME media type,
> application/xml, was not found
> Feb 16, 2009 5:44:37 PM
> com.sun.jersey.server.impl.application.WebApplicationImpl onException
> SEVERE: Internal server error
> javax.ws.rs.WebApplicationException
> at
> com
> .sun
> .jersey.spi.container.ContainerResponse.write(ContainerResponse.java:
> 240)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl._handleRequest(WebApplicationImpl.java:593)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
> at
> com
> .sun
> .jersey
> .spi
> .container.servlet.ServletContainer.service(ServletContainer.java:359)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:
> 803)
> at
> org
> .apache
> .catalina
> .core
> .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
> 269)
> at
> org
> .apache
> .catalina
> .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> at
> org
> .apache
> .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
> 213)
> at
> org
> .apache
> .catalina.core.StandardContextValve.invoke(StandardContextValve.java:
> 174)
> at
> org
> .apache
> .catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
> org
> .apache
> .catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> at
> org
> .apache
> .catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
> 108)
> at
> org
> .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> 174)
> at
> org
> .apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 874)
> at org.apache.coyote.http11.Http11BaseProtocol
> $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
> :665)
> at
> org
> .apache
> .tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
> 528)
> at
> org
> .apache
> .tomcat
> .util
> .net
> .LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> at org.apache.tomcat.util.threads.ThreadPool
> $ControlRunnable.run(ThreadPool.java:689)
> at java.lang.Thread.run(Thread.java:595)
>
> Not sure if i am missing anything... i have all Jersey and JAXB jars
> in WEB-INF/lib
>
> Thanks
> Mukesh