Hi Peter,
I am glad the new ComponentProvider and Servlet worked for you.
Do you have the jettison-1.0-RC1.jar in your class path?
If not you should get warnings at start up like those shown at the end
of the email. Components for message body readers/writers are loaded
dynamically as we want to have a very small set of required
dependencies. See here for the description of optional dependencies [1].
I don't know how to represent such optional dependencies with Maven.
Should we have a set of profiles?
Paul.
[1]
https://jersey.dev.java.net/source/browse/*checkout*/jersey/trunk/jersey/docs/dependencies.html
[java] Feb 4, 2008 10:23:11 AM
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
[java] WARNING: A dependent class,
org/codehaus/jettison/json/JSONException, of the class
com.sun.ws.rest.impl.provider.entity.JSONJAXBElementProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyReader is
not found. The provider implementation is ignored.
[java] Feb 4, 2008 10:23:11 AM
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
[java] WARNING: A dependent class,
org/codehaus/jettison/json/JSONException, of the class
com.sun.ws.rest.impl.provider.entity.JSONArrayProvider implementing the
provider interface javax.ws.rs.ext.MessageBodyReader is not found. The
provider implementation is ignored.
[java] Feb 4, 2008 10:23:11 AM
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
[java] WARNING: A dependent class,
org/codehaus/jettison/json/JSONException, of the class
com.sun.ws.rest.impl.provider.entity.JSONObjectProvider implementing the
provider interface javax.ws.rs.ext.MessageBodyReader is not found. The
provider implementation is ignored.
fjksl sdfmlsdfjlmk wrote:
> 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
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109