users@jersey.java.net

Re: [Jersey] Problem with Jersey lab

From: Comerford, Sean <Sean.Comerford_at_espn3.com>
Date: Wed, 23 Sep 2009 19:47:10 +0000

Yeah, itıs clearly a dependency problem... my fault for trying to short cut
the instructions in the lab :-/

The example doesnıt work running in a stand alone grizzly instance but does
work just fine running in Glassfish itself so obviously Iım missing a jar.

So never mind and sorry for the spam!

On 9/23/09 3:21 PM, "Paul Sandoz" <Paul.Sandoz_at_Sun.COM> wrote:

> Hi Sean,
>
> Did you forget to include the dependencies for JSON?
>
> If so there should be something in the server log like "A message body writer
> for Java type..."
>
> I am not that familiar with the lab but Martin and Naresh who designed and
> co-presented at JavaOne can reply tomorrow.
>
> Paul.
>
> On Sep 23, 2009, at 8:52 PM, Comerford, Sean wrote:
>
>> Newbie question: Iım going through Jersey: Building RESTful Web Services on
>> the Java Platform LAB-5542
>>
>> Thing are fine until exercise 2, step 14 when I specify the application/json
>> as the accept header value... I get this exception as the response:
>>
>> javax.ws.rs.WebApplicationException
>> at
>> com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:2
>> 53)
>> at
>> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebA
>> pplicationImpl.java:763)
>> at
>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebAp
>> plicationImpl.java:689)
>> at
>> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebAp
>> plicationImpl.java:680)
>> at
>> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:3
>> 24)
>> at
>> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContaine
>> r.java:425)
>> at
>> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContaine
>> r.java:604)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>> at
>> com.sun.grizzly.http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:18
>> 8)
>> at
>> com.sun.grizzly.http.servlet.FilterChainImpl.invokeFilterChain(FilterChainImp
>> l.java:137)
>> at
>> com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:278)
>> at
>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:165)
>> at
>> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:659)
>> at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:577)
>> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:829)
>> at
>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java
>> :162)
>> at
>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolCha
>> in.java:136)
>> at
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>> at
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>> at
>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>> at
>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java
>> :67)
>> at
>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.jav
>> a:886)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:90
>> 8)
>> at java.lang.Thread.run(Thread.java:637)
>>
>> To be clear, text/plain and application/xml work fine but no dice for json.
>>
>> Probably missed some config step here but not sure what?
>>
>> --
>> Sean Comerford, Software Engineer
>> ESPN.com Site Architecture Group
>> Office: 860.766.6454 Cell: 860.329.5842
>>
>>
>
>

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