tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schlichtherle <christ...@schlichtherle.de>
Subject JAX-RS Exception Mapper doesn't like injected constructors
Date Thu, 22 Aug 2013 16:03:56 GMT
Hi,

on another subject, I get an exception at startup when deploying a JAX-RS exception mapper
which has a public constructor with an inject context. The exception is:

SEVERE: can't instantiate net.java.trueupdate.jax.rs.server.UpdateServiceExceptionMapper
java.lang.InstantiationException: net.java.trueupdate.jax.rs.server.UpdateServiceExceptionMapper
	at java.lang.Class.newInstance(Class.java:359)
	at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.providers(CxfRsHttpListener.java:178)
	at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.configureFactory(CxfRsHttpListener.java:220)
	at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deploy(CxfRsHttpListener.java:146)
	at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployEJB(CxfRsHttpListener.java:120)
	at org.apache.openejb.server.rest.RESTService.deployEJB(RESTService.java:448)
	at org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:215)
	at org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)

The constructor looks like this:

    public UpdateServiceExceptionMapper(
            final @Context HttpHeaders headers) {
        this.headers = Objects.requireNonNull(headers);
    }

As soon as I refactor to private field injection instead, the exception does not appear.

In either case, the JAX-RS exception mapper works when needed, so I guess this is just an
annoyance.

Regards,
Christian Schlichtherle


Mime
View raw message