Quantcast

Nullpointer and IllegalExpcetion are not handled by ExceptionMapper Jersey 1.4

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Nullpointer and IllegalExpcetion are not handled by ExceptionMapper Jersey 1.4

Albert
Hi
I read many threads at jersey and it is listed as bug in jersey 1.1.5. Is it fixed letter on?
I am using Jersey 1.4 and Exception mapper is not working for nullpointer and Illegal Argument exception. I made Exception Mapper on runetimeException but it gives below error. Any idea how it can be solved.

Signature.
public class NullPointerExceptionMapper implements ExceptionMapper<RuntimeException> {


EVERE: Exception mapper edu.apollogrp.platform.authz.rest.provider.NullPointerE
xceptionMapper@5fbbf3 for Throwable java.lang.NullPointerException threw a Runti
meException when attempting to obtain the response
Mar 8, 2012 9:09:16 AM com.sun.jersey.spi.container.ContainerResponse traceExcep
tion
SEVERE: Mapped exception to response: 500 (Internal Server Error)
java.lang.NullPointerException
        at edu.apollogrp.platform.authz.rest.provider.NullPointerExceptionMapper
.toResponse(NullPointerExceptionMapper.java:23)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Nullpointer and IllegalExpcetion are not handled by ExceptionMapper Jersey 1.4

Marek Potociar
Hi, seems that your exception mapper is throwing another NPE when trying to map the initial NPE to a response. Please
try to debug your custom exception mapper code.

Marek

On 03/08/2012 05:19 PM, Albert wrote:

> Hi
> I read many threads at jersey and it is listed as bug in jersey 1.1.5. Is it
> fixed letter on?
> I am using Jersey 1.4 and Exception mapper is not working for nullpointer
> and Illegal Argument exception. I made Exception Mapper on runetimeException
> but it gives below error. Any idea how it can be solved.
>
> Signature.
> public class NullPointerExceptionMapper implements
> ExceptionMapper<RuntimeException> {
>
>
> EVERE: Exception mapper
> edu.apollogrp.platform.authz.rest.provider.NullPointerE
> xceptionMapper@5fbbf3 for Throwable java.lang.NullPointerException threw a
> Runti
> meException when attempting to obtain the response
> Mar 8, 2012 9:09:16 AM com.sun.jersey.spi.container.ContainerResponse
> traceExcep
> tion
> SEVERE: Mapped exception to response: 500 (Internal Server Error)
> java.lang.NullPointerException
>         at
> edu.apollogrp.platform.authz.rest.provider.NullPointerExceptionMapper
> .toResponse(NullPointerExceptionMapper.java:23)
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Nullpointer-and-IllegalExpcetion-are-not-handled-by-ExceptionMapper-Jersey-1-4-tp7355433p7355433.html
> Sent from the Jersey mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Nullpointer and IllegalExpcetion are not handled by ExceptionMapper Jersey 1.4

Albert
Thanks It worked for me. i had code which was throwing these error
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Nullpointer and IllegalExpcetion are not handled by ExceptionMapper Jersey 1.4

ashrekhi
Hey, I am stuck with the same problem, I am getting the same error. How did you fix it? Any chance you remember?

Thanks
Loading...