Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » MoxyJsonProvider UnmarshalException stackTrace logging(How to make MoxyJsonProvider log UnmarshalException stackTrace )
MoxyJsonProvider UnmarshalException stackTrace logging [message #1092258] Thu, 22 August 2013 14:22 Go to next message
Iñaki Prieto is currently offline Iñaki Prieto
Messages: 4
Registered: August 2013
Junior Member
I've testing REST services configured with RESTEasy + moxy (using MoxyJsonProvider). All works ok but when some service fails unmarshalling y cannot see the complete stacktrace. The reason (i think) is the following code in MoxyJsonProvider(639-646):

         }
        } catch(UnmarshalException unmarshalException) {
            ResponseBuilder builder = Response.status(Status.BAD_REQUEST);
            throw new WebApplicationException(builder.build());
        } catch(JAXBException jaxbException) {
            throw new WebApplicationException(jaxbException);
        }
    }



The UnmarshalException is not logged.

The resulting log looks like the following:

javax.ws.rs.WebApplicationException: HTTP 400 Bad Request
        at org.eclipse.persistence.jaxb.rs.MOXyJsonProvider.readFrom(MOXyJsonProvider.java:642)
        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:59)
        at org.jboss.resteasy.core.interception.ServerReaderInterceptorContext.readFrom(ServerReaderInterceptorContext.java:62)
        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:51)
        at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)
        at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
        at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:150)
        at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:88)
        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:111)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:272)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:229)
        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:216)
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)



How can i print the whole stack trace?
Re: MoxyJsonProvider UnmarshalException stackTrace logging [message #1092448 is a reply to message #1092258] Thu, 22 August 2013 20:19 Go to previous messageGo to next message
Blaise Doughan is currently offline Blaise Doughan
Messages: 163
Registered: July 2009
Senior Member

Hello,

Thank you for pointing out this issue (see: http://bugs.eclipse.org/415712). I have just fixed this in the EclipseLink 2.5.1 and 2.6.0 streams. You will be able to download a nightly build from the following link starting Friday August 23rd:
- http://www.eclipse.org/eclipselink/downloads/nightly.php

-Blaise
Re: MoxyJsonProvider UnmarshalException stackTrace logging [message #1095643 is a reply to message #1092448] Tue, 27 August 2013 10:30 Go to previous message
Iñaki Prieto is currently offline Iñaki Prieto
Messages: 4
Registered: August 2013
Junior Member
Ok, it works fine. Thanks!
Previous Topic:JAXB : EclipseLink-3002 while unmarshalling xml even JAXB RI works
Next Topic:ReadOnly mapping attribute causes inserts
Goto Forum:
  


Current Time: Fri Oct 31 11:43:18 GMT 2014

Powered by FUDForum. Page generated in 0.01886 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software