users@jersey.java.net

Re: [Jersey] Exception during execution of POST query

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 18 Feb 2010 09:26:38 +0100

Hi Philip,

OSGI is not currently supported in 1.1.5. But it is planned for 1.2.

If you like you can check out the Jersey trunk:

   svn checkout https://jersey.dev.java.net/svn/jersey/trunk/jersey
jersey --username <username>

then go into the directory:

   osgi

and build using SE 6 and maven >= 2.0.9. Then use those artifacts
produces. (Note that the next step in our OSGi development process is
to avoid a duplication of artifacts.)

We would greatly appreciate if you could try this out as we want to
know if it works for a number of scenarios and we have correctly
tested things before we release.

Thanks,
Paul.

On Feb 17, 2010, at 3:06 PM, Philip Yankov wrote:

> Hi list,
>
> I have one very strange problem when trying to execute one simple
> example using Categories and Books in them. I am trying to run
> Jersey in OSGI environment and I don't know where to find all
> bundles needed to run version 1.1.5, that's why I downloaded jars
> and try to convert them to be bundles. When try to execute GET
> queries (from my example) they are working, but when I try POST
> query the exception is thrown.
>
> Here is the stacktrace :
>
> java.lang.NullPointerException
> at
> com
> .sun
> .jersey
> .core
> .impl
> .provider
> .entity.XMLRootElementProvider.readFrom(XMLRootElementProvider.java:
> 110)
> at
> com
> .sun
> .jersey
> .core
> .provider
> .jaxb
> .AbstractRootElementProvider
> .readFrom(AbstractRootElementProvider.java:105)
> at
> com
> .sun
> .jersey
> .spi.container.ContainerRequest.getEntity(ContainerRequest.java:444)
> at
> com
> .sun
> .jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider
> $EntityInjectable.getValue(EntityParamDispatchProvider.java:137)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .inject
> .InjectableValuesProvider
> .getInjectableValues(InjectableValuesProvider.java:43)
> at
> com
> .sun
> .jersey
> .server
> .impl.model.method.dispatch.AbstractResourceMethodDispatchProvider
> $
> EntityParamInInvoker
> .getParams(AbstractResourceMethodDispatchProvider.java:119)
> at
> com
> .sun
> .jersey
> .server
> .impl.model.method.dispatch.AbstractResourceMethodDispatchProvider
> $
> ResponseOutInvoker
> ._dispatch(AbstractResourceMethodDispatchProvider.java:166)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .model
> .method
> .dispatch
> .ResourceJavaMethodDispatcher
> .dispatch(ResourceJavaMethodDispatcher.java:67)
> at
> com
> .sun
> .jersey
> .server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:259)
> at
> com
> .sun
> .jersey
> .server
> .impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
> at
> com
> .sun
> .jersey
> .server
> .impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83)
> at
> com
> .sun
> .jersey
> .server
> .impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .uri
> .rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:71)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl._handleRequest(WebApplicationImpl.java:990)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.handleRequest(WebApplicationImpl.java:941)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.handleRequest(WebApplicationImpl.java:932)
> at
> com
> .sun
> .jersey.spi.container.servlet.WebComponent.service(WebComponent.java:
> 384)
> at
> com
> .sun
> .jersey
> .spi
> .container.servlet.ServletContainer.service(ServletContainer.java:451)
> at
> com
> .sun
> .jersey
> .spi
> .container.servlet.ServletContainer.service(ServletContainer.java:632)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
>
> Does anyone know where the problem might be ?
>
> Best regards,
> Philip Yankov