It turns out this is caused by the fact that "@Context MultiPartConfig
config" in the constructor returns null. The thing is, the Javadoc doesn't
explain if I'm supposed to provide some sort of configuration and if so how
to do it. I could really use your help ;)
BTW, I see "com.sun.jersey.multipart.impl.MultiPartConfigProvider" being
loaded by Jersey on startup so I am expecting this to work...
Thanks,
Gili
Gili wrote:
>
> The server code is throwing this exception for some reason. I'll let you
> know if I ever figure out the source of the problem. Either way,
> jersey-multipart should throw an clearer error message...
>
> Thanks,
> Gili
>
> com.sun.jersey.api.container.ContainerException: Exception injecting
> parameters to Web resource method
> at
> com.sun.jersey.impl.model.method.dispatch.EntityParamDispatchProvider$EntityParamInInvoker.getParams(EntityParamDispatchProvider.java:105)
> at
> com.sun.jersey.impl.model.method.dispatch.EntityParamDispatchProvider$ResponseOutInvoker._dispatch(EntityParamDispatchProvider.java:154)
> at
> com.sun.jersey.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:85)
> at
> com.sun.jersey.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:123)
> at
> com.sun.jersey.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
> at
> com.sun.jersey.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
> at
> com.sun.jersey.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:722)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:692)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:344)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> at
> com.wideplay.warp.servlet.ServletDefinition.doService(ServletDefinition.java:184)
> at
> com.wideplay.warp.servlet.ServletDefinition.service(ServletDefinition.java:108)
> at
> com.wideplay.warp.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:39)
> at
> com.wideplay.warp.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:57)
> at
> com.wideplay.warp.persist.SessionFilter$2.run(SessionFilter.java:68)
> at
> com.wideplay.warp.util.Lifecycles.failEarlyAndLeaveNoOneBehind(Lifecycles.java:29)
> at
> com.wideplay.warp.persist.SessionFilter.doFilter(SessionFilter.java:77)
> at
> com.wideplay.warp.servlet.FilterDefinition.doFilter(FilterDefinition.java:98)
> at
> com.wideplay.warp.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:52)
> at
> com.wideplay.warp.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:50)
> at com.wideplay.warp.servlet.WebFilter.doFilter(WebFilter.java:83)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
> 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.NullPointerException
> at
> com.sun.jersey.multipart.impl.MultiPartReader.readFrom(MultiPartReader.java:157)
> at
> com.sun.jersey.multipart.impl.MultiPartReader.readFrom(MultiPartReader.java:70)
> at
> com.sun.jersey.spi.container.ContainerRequest.getEntity(ContainerRequest.java:348)
> at
> com.sun.jersey.impl.model.method.dispatch.EntityParamDispatchProvider$EntityInjectable.getValue(EntityParamDispatchProvider.java:81)
> at
> com.sun.jersey.impl.model.method.dispatch.EntityParamDispatchProvider$EntityParamInInvoker.getParams(EntityParamDispatchProvider.java:99)
> ... 49 more
>
>
--
View this message in context: http://n2.nabble.com/jersey-multipart-throwing-NPE-tp1560622p1560639.html
Sent from the Jersey mailing list archive at Nabble.com.