dev@jersey.java.net

500 server error occured while invoking the REST service through CURL or WGET

From: <amohan_3cse_at_yahoo.co.in>
Date: Fri, 26 Aug 2011 07:42:06 +0000 (GMT)

Hi Folks,

I've deployed a sample REST service, developed in Jersey 1.8 and
deployed on Weblogic 10.3.4 on Linux x86 H/W.

The application responding perfectly when the it was hit through SOAP
UI / POSTER or just browser.

But the same throws 500 error, when it was invoked via WGET or CURL.
Please have a look at the exception. Let me know if it sounds any known
issues in jersey server impl.
There was no complex logic put in there in my code.

------------------------------------

<[ServletContext_at_310268508[app:MeltemiApplicationLogic module:meltemi
path:/meltemi spec-version:2.5 version:1.0.1]] Servlet failed with
Exception
java.lang.NullPointerException
        at
com.sun.jersey.spi.container.ContainerResponse.getStatus(ContainerRespo
nse.java:564)
        at
com.sun.jersey.spi.container.ContainerResponse$CommittingOutputStream.c
ommitWrite(ContainerResponse.java:156)
        at
com.sun.jersey.spi.container.ContainerResponse$CommittingOutputStream.w
rite(ContainerResponse.java:133)
        at
com.sun.jersey.core.util.ReaderWriter.writeTo(ReaderWriter.java:115)
        at
com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider.writeT
o(AbstractMessageReaderWriterProvider.java:76)
        at
com.sun.jersey.core.impl.provider.entity.InputStreamProvider.writeTo(In
putStreamProvider.java:98)
        at
com.sun.jersey.core.impl.provider.entity.InputStreamProvider.writeTo(In
putStreamProvider.java:59)
        at
com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.
java:306)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleReques
t(WebApplicationImpl.java:1437)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest
(WebApplicationImpl.java:1349)
        at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest
(WebApplicationImpl.java:1339)
        at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.
java:416)
        at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletCo
ntainer.java:537)
        at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletCo
ntainer.java:699)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(S
tubSecurityHelper.java:227)
        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurity
Helper.java:125)
        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:
300)
        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:
183)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.
wrapRun(WebAppServletContext.java:3717)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.
run(WebAppServletContext.java:3681)
        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedS
ubject.java:321)
        at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:12
0)
        at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppSer
vletContext.java:2277)
        at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletCon
text.java:2183)
        at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.jav
a:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

Thanks,
Mohan