users@jersey.java.net

Nullpointer exception in ExceptionMapper on jersey 1.1.5 (but not in 1.1.2)

From: Morten <mortench2004_at_yahoo.dk>
Date: Wed, 3 Mar 2010 14:09:02 -0800 (PST)

After a long break from java/jersey work I just upgraded from jersey 1.1.2 to 1.1.5 and since then my exception mapper fails to instantiate. The exception I get is: SEVERE: The provider class, class com.myapp.controller.CustomExceptionMapper, could not be instantiated. Processing will continue but the class will not be utilized java.lang.NullPointerException at com.sun.jersey.server.impl.model.ResourceClass.processOptions(ResourceClass.java:374) at com.sun.jersey.server.impl.model.ResourceClass.processMethods(ResourceClass.java:323) at com.sun.jersey.server.impl.model.ResourceClass.<init>(ResourceClass.java:133) My mapper looks like this: @Provider public class CustomExceptionMapper implements ExceptionMapper<java.lang.Throwable> { private final Logger log = Logger.getLogger(CustomExceptionMapper.class.getName()); private UriInfo uriInfo; @com.sun.jersey.spi.inject.Inject protected WebServer server; public CustomExceptionMapper(@Context UriInfo uriInfo) { this.uriInfo = uriInfo; } public Response toResponse(java.lang.Throwable ex) { // ... } } I suspect this is a bug in jersey... Any ideas/help would be appreciated ? BTW: Any plans for a maintaince release of jersey 1.1.x with bugfixes since release of 1.1.5 ? /Morten __________________________________________________ Bruger du Yahoo!? Er du tręt af spam? Yahoo!Mail har den bedste spambeskyttelse, der findes http://dk.mail.yahoo.com