users@jersey.java.net

GF 2.1 vs 2.1.1?

From: Comerford, Sean <Sean.Comerford_at_espn3.com>
Date: Mon, 26 Oct 2009 19:14:01 +0000

So I have a simple jersey based webapp exposing some RESTful endpoints.

It works fine on my local machine for both XML and JSON.

But when I install it on a dev server for the front end guys, it throws an
³Internal Server Error² when the Accept header is set to application/json
(XML works fine).

The only apparent difference is my local Glassfish instances is v2.1.1 b31
while the dev instance is v2.1 b60e

Perhaps Iım the 2.1 instance is missing some library thatıs included by
default in GF v2.1.1?

FWIW, hereıs the stack trace:

[#|2009-10-26T15:03:04.064-0400|SEVERE|sun-appserver2.1|com.sun.jersey.spi.c
ontainer.ContainerResponse|_ThreadID=16;_ThreadName=httpSSLWorkerThread-2080
-1;_RequestID=787dac27-ec89-4fbc-bfbb-951652192b04;|A message body writer
for Java type, class
com.espn.sports.persistence.basketball.BasketballTeamEntity, and MIME media
type, application/json, was not found|#]

[#|2009-10-26T15:03:04.064-0400|SEVERE|sun-appserver2.1|com.sun.jersey.serve
r.impl.application.WebApplicationImpl|_ThreadID=16;_ThreadName=httpSSLWorker
Thread-2080-1;_RequestID=787dac27-ec89-4fbc-bfbb-951652192b04;|Internal
server error
javax.ws.rs.WebApplicationException
    at
com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:
253)
    at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(Web
ApplicationImpl.java:763)
    at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebA
pplicationImpl.java:689)
    at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebA
pplicationImpl.java:680)
    at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:
324)
    at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContain
er.java:425)
    at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContain
er.java:604)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFi
lterChain.java:427)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:315)
    at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:287)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:218)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648
)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593
)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLock
ingStandardPipeline.java:98)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222
)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648
)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593
)
    at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:166)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648
)
    at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593
)
    at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
    at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
    at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(
DefaultProcessorTask.java:647)
    at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(Defa
ultProcessorTask.java:579)
    at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(Defaul
tProcessorTask.java:831)
    at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTas
k(DefaultReadTask.java:341)
    at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadT
ask.java:263)
    at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadT
ask.java:214)
    at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUn
ificationPipeline.java:380)
    at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerTh
read.java:106)
|#]

-- 
Sean Comerford, Software Engineer
ESPN.com Site Architecture Group
Office: 860.766.6454    Cell: 860.329.5842