On Sep 23, 2009, at 9:47 PM, Comerford, Sean wrote:
> 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.
>
See here for the dependencies:
https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.1.2-ea/jersey/dependencies.html
> So never mind and sorry for the spam!
>
np,
Paul.
> 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:253)
>>> at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .application
>>> .WebApplicationImpl._handleRequest(WebApplicationImpl.java:763)
>>> at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .application
>>> .WebApplicationImpl.handleRequest(WebApplicationImpl.java:689)
>>> at
>>> com
>>> .sun
>>> .jersey
>>> .server
>>> .impl
>>> .application
>>> .WebApplicationImpl.handleRequest(WebApplicationImpl.java:680)
>>> at
>>> com
>>> .sun
>>> .jersey
>>> .spi.container.servlet.WebComponent.service(WebComponent.java:324)
>>> at
>>> com
>>> .sun
>>> .jersey
>>> .spi
>>> .container.servlet.ServletContainer.service(ServletContainer.java:
>>> 425)
>>> at
>>> com
>>> .sun
>>> .jersey
>>> .spi
>>> .container.servlet.ServletContainer.service(ServletContainer.java:
>>> 604)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>> at
>>> com
>>> .sun
>>> .grizzly
>>> .http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:188)
>>> at
>>> com
>>> .sun
>>> .grizzly
>>> .http
>>> .servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.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(DefaultProtocolChain.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.java:886)
>>> at java.util.concurrent.ThreadPoolExecutor
>>> $Worker.run(ThreadPoolExecutor.java:908)
>>> 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