jersey
  1. jersey
  2. JERSEY-2320

EJB singleton bean registered as an exception mapper causes deployment failure

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.9
    • Component/s: containers
    • Labels:
      None
    • Environment:

      GlassFish

      Description

      Exception mapper factory is given a dynamic proxy. The factory then fails to determine type parameter from that proxy which causes a processing exception.

      import javax.ejb.Singleton;
      import javax.ws.rs.ext.ExceptionMapper;
      import javax.ws.rs.ext.Provider;
      
      @Provider
      @Singleton
      public class DefaultExceptionMapper implements ExceptionMapper<Throwable> {
      ...
      
      [2014-01-07T15:05:07.945+0100] [glassfish 4.0] [SEVERE] [] [javax.enterprise.web] [tid: _ThreadID=45 _ThreadName=admin-listener(5)] [timeMillis: 1389103507945] [levelValue: 1000] [[
        WebModule[/api]StandardWrapper.Throwable
      MultiException stack 1 of 2
      javax.ws.rs.ProcessingException: Could not find exception type for given ExceptionMapper class: class com.sun.proxy.$Proxy253.
      	at org.glassfish.jersey.internal.ExceptionMapperFactory.getType(ExceptionMapperFactory.java:213)
      	at org.glassfish.jersey.internal.ExceptionMapperFactory.getExceptionType(ExceptionMapperFactory.java:183)
      	at org.glassfish.jersey.internal.ExceptionMapperFactory.<init>(ExceptionMapperFactory.java:160)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
      	at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1117)
      	at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:300)
      	at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:417)
      	at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456)
      	at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:112)
      	at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:100)
      	at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:154)
      	at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:199)
      	at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:150)
      	at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2395)
      	at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:589)
      	at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:77)
      	at org.jvnet.hk2.internal.Utilities.justInject(Utilities.java:813)
      	at org.jvnet.hk2.internal.ServiceLocatorImpl.inject(ServiceLocatorImpl.java:850)
      	at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:925)
      	at org.jvnet.hk2.internal.ServiceLocatorImpl.createAndInitialize(ServiceLocatorImpl.java:916)
      	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:502)
      	at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:162)
      	at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:304)
      	at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
      	at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
      	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
      	at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
      	at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:301)
      	at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
      	at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:169)
      	at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:359)
      

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Jakub Podlesak
              Reporter:
              Jakub Podlesak
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified