users@jersey.java.net

[Jersey] How to get more error/logging/debug info

From: <daniel.cklam_at_gmail.com>
Date: Mon, 4 Jun 2012 05:11:48 +0000 (GMT)

Hi there,

Please help! I'm new to using GlassFish/Jersey.. had more experience
with PHP.

I have a method like the following to handle web service request:

    @POST
    public Response createNewRecord(JAXBElement<MyBean> beanJaxb) {

        MyBean newBean = beanJaxb.getValue();
        em.persist(newBean);

        // According to REST-ful convention, the URI of the new entry
will be returned.
        URI beanUri= uriInfo.getAbsolutePathBuilder().path(newBean
.getId().toString()).build();

        return Response.created(beanUri).build();
    }

All's well. However, let's say the service request sender made a
mistake when writing the request body, e.g. some incorrect parameter
type, then the request will fail.

My question is, when the request fails, currently it would only give me
generic messages like,

[#|2012-06-04T14:14:30.059+1000|WARNING|glassfish3.1.2|javax.enterprise
.system.container.web.com.sun.enterprise.web|_ThreadID=25;_ThreadName=T
hread-2;|StandardWrapperValve[com.rockableapps.lamophone.ApplicationCon
fig]: PWC1406: Servlet.service() for servlet
com.rockableapps.lamophone.ApplicationConfig threw exception
java.lang.Error: Error: could not match input
 at
com.sun.jersey.json.impl.reader.JsonLexer.zzScanError(JsonLexer.java:49
1)
 at com.sun.jersey.json.impl.reader.JsonLexer.yylex(JsonLexer.java:751)
 at
com.sun.jersey.json.impl.reader.JsonXmlStreamReader.nextToken(JsonXmlSt
reamReader.java:160)
 at
com.sun.jersey.json.impl.reader.JsonXmlStreamReader.readNext(JsonXmlStr
eamReader.java:187)
 at ...

...which doesn't give me a clue where to start looking to fix the
error (e.g. the field/param that caused this). Is there a way to change
the error/logging/debug settings so that I would get that info?

Tried searching the net for 1/2 hour and ended no where as well.

We're just starting to prototype and want to use GlassFish/Jersery for
our dev/prod environment, however if it's giving us too much pain we'll
have to switch..