users@jersey.java.net

MessageBodyReader not found

From: fjksl sdfmlsdfjlmk <peterdk79_at_gmail.com>
Date: Mon, 4 Feb 2008 00:25:33 +0100

Hi,

I'm trying to make a smaller application using maven, spring, JPA and off
course JAX-RS.
The application is now pretty much comparable with the Bookmark example,
with the difference that I'm using the SpringServlet as described by Paul
Sandoz.
Which went all very fluent. When I then try curl for a "PUT" operation I get
this exception:

com.sun.ws.rest.api.container.ContainerException: Exception injecting
parameters to Web resource method
    at
com.sun.ws.rest.impl.model.method.dispatch.EntityParamDispatchProvider$EntityParamInInvoker.getParams
(EntityParamDispatchProvider.java:79)
    at
com.sun.ws.rest.impl.model.method.dispatch.EntityParamDispatchProvider$ResponseOutInvoker._dispatch
(EntityParamDispatchProvider.java:122)
    at
com.sun.ws.rest.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch
(ResourceJavaMethodDispatcher.java:66)
    at com.sun.ws.rest.impl.uri.rules.HttpMethodRule.accept(
HttpMethodRule.java:104)
    at com.sun.ws.rest.impl.uri.rules.SubLocatorRule.accept(
SubLocatorRule.java:65)
    at com.sun.ws.rest.impl.uri.rules.RightHandPathRule.accept(
RightHandPathRule.java:83)
    at com.sun.ws.rest.impl.uri.rules.ResourceClassRule.accept(
ResourceClassRule.java:55)
    at com.sun.ws.rest.impl.uri.rules.RightHandPathRule.accept(
RightHandPathRule.java:83)
    at com.sun.ws.rest.impl.uri.rules.RootResourceClassesRule.accept(
RootResourceClassesRule.java:49)
    at com.sun.ws.rest.impl.application.WebApplicationImpl.handleRequest(
WebApplicationImpl.java:349)
    at com.sun.ws.rest.spi.container.servlet.ServletContainer.service(
ServletContainer.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(
ApplicationFilterChain.java:411)
    at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:290)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(
StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(
StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(
StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(
StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(
StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(
StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(
StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(
StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(
StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java
:272)
    at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(
DefaultProcessorTask.java:637)
    at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(
DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process
(DefaultProcessorTask.java:813)
    at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask
(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(
DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(
DefaultReadTask.java:214)
    at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask
(PortUnificationPipeline.java:380)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java
:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(
SSLWorkerThread.java:106)
Caused by: java.lang.IllegalArgumentException: A message body reader for
Java type, class org.json.JSONObject, and MIME media type, application/json,
was not found
    at
com.sun.ws.rest.impl.application.MessageBodyFactory.getMessageBodyReader(
MessageBodyFactory.java:134)
    at com.sun.ws.rest.spi.container.AbstractContainerRequest.getEntity(
AbstractContainerRequest.java:201)
    at
com.sun.ws.rest.impl.model.method.dispatch.EntityParamDispatchProvider$EntityExtractor.extract
(EntityParamDispatchProvider.java:57)
    at
com.sun.ws.rest.impl.model.method.dispatch.EntityParamDispatchProvider$EntityParamInInvoker.getParams
(EntityParamDispatchProvider.java:73)
    ... 38 more

I'm using glassfish V2, Java 1.6_04 and I have to say that I'm a little lost
right now. So, this mailinglist seemed the best way to get some help or tips
in solving this exception.

Kind regards,

Peter