glassfish
  1. glassfish
  2. GLASSFISH-13650

Jersey NullPointerException, problem registering interceptor

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1_ms07
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      13,650

      Description

      A colleague is reporting the following stack trace from b21. This occurs on a
      Resource class that has been annotated with @ManagedBean, and which contains an
      @EJB-annotated field within it.

      The JAX-RS Application subclass to which it belongs is effectively a no-op override.

      [#|2010-09-28T12:30:05.413-0400|SEVERE|glassfish3.1|com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer|_ThreadID=15;_ThreadName=Thread-1;|Error
      when configuring to use the EJB interceptor binding API. JAX-RS EJB support is
      disabled.

      java.lang.reflect.InvocationTargetException

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at
      com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer.initialize(EJBComponentProviderFactoryInitilizer.java:80)

      at
      com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:552)

      at
      com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:280)

      at
      com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:586)

      at
      com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:213)

      at
      com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:342)

      at
      com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:516)

      at javax.servlet.GenericServlet.init(GenericServlet.java:244)

      at
      org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1427)

      at
      org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1072)

      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189)

      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

      at
      org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

      at
      com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

      at
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

      at
      org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)

      at
      com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)

      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:824)

      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:721)

      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1014)

      at
      com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:220)

      at
      com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)

      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)

      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)

      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)

      at
      com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)

      at
      com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)

      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)

      at
      com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:530)

      at
      com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:511)

      at java.lang.Thread.run(Thread.java:619)

      Caused by: java.lang.NullPointerException

      at
      com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.registerRuntimeInterceptor(ManagedBeanManagerImpl.java:325)

      at
      com.sun.ejb.containers.InternalInterceptorBindingImpl.registerInterceptor(InternalInterceptorBindingImpl.java:110)

      ... 38 more

        Issue Links

          Activity

          Hide
          Marek Potociar added a comment -

          Reassigning to proper subcomponent

          Show
          Marek Potociar added a comment - Reassigning to proper subcomponent
          Hide
          marina vatkina added a comment -

          Laird, Does the error appear at deployment or at the execution? I built the ear
          from IT 13556 and modified the application.xml for <ejb> modules to be before or
          after the <web> module. Either way I could successfully deploy all versions of
          such ear to the latest build.

          If I don't have a test case, I'd need to close the bug as "worksforme".

          -marina

          Show
          marina vatkina added a comment - Laird, Does the error appear at deployment or at the execution? I built the ear from IT 13556 and modified the application.xml for <ejb> modules to be before or after the <web> module. Either way I could successfully deploy all versions of such ear to the latest build. If I don't have a test case, I'd need to close the bug as "worksforme". -marina
          Hide
          marina vatkina added a comment -

          Non-CDI version of the test case (from <a href="show_bug.cgi?id=13556">IT
          13556</a>) works fine, but the CDI-enabled version throws an NPE in the Weld
          code at runtime (http://localhost:8080/frobnicator-war/):
          com.sun.enterprise.container.common.spi.util.InjectionException: Error creating
          managed object for class ljnelson.frobnicator.web.FrobnicatorServlet
          at
          com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:317)
          at com.sun.enterprise.web.WebContainer.createServletInstance(WebContainer.java:695)
          at com.sun.enterprise.web.WebModule.createServletInstance(WebModule.java:1945)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1263)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1070)
          at
          org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189)
          at
          org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
          at
          com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
          at
          com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
          at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:817)
          at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:718)
          at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1007)
          at
          com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
          at
          com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
          at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
          at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
          at
          com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
          at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
          at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
          at
          com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
          at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
          at java.lang.Thread.run(Thread.java:680)
          Caused by: java.lang.NullPointerException
          at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:729)
          at
          org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:137)
          at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:869)
          at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:881)
          at
          org.jboss.weld.manager.SimpleInjectionTarget$1.proceed(SimpleInjectionTarget.java:122)
          at
          org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:134)
          at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:50)
          at
          org.jboss.weld.manager.SimpleInjectionTarget.inject(SimpleInjectionTarget.java:116)
          at
          org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:224)
          at
          org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:176)
          at
          com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:478)
          at
          com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:428)
          at
          com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:300)
          ... 28 more

          #]
          Show
          marina vatkina added a comment - Non-CDI version of the test case (from <a href="show_bug.cgi?id=13556">IT 13556</a>) works fine, but the CDI-enabled version throws an NPE in the Weld code at runtime ( http://localhost:8080/frobnicator-war/): com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class ljnelson.frobnicator.web.FrobnicatorServlet at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:317) at com.sun.enterprise.web.WebContainer.createServletInstance(WebContainer.java:695) at com.sun.enterprise.web.WebModule.createServletInstance(WebModule.java:1945) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1263) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1070) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:817) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:718) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1007) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NullPointerException at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:729) at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:137) at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:869) at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:881) at org.jboss.weld.manager.SimpleInjectionTarget$1.proceed(SimpleInjectionTarget.java:122) at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:134) at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:50) at org.jboss.weld.manager.SimpleInjectionTarget.inject(SimpleInjectionTarget.java:116) at org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:224) at org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:176) at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:478) at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:428) at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:300) ... 28 more #]
          Hide
          Sivakumar Thyagarajan added a comment -

          The NPE in BeanManagerImpl is being tracked as part of GLASSFISH-14832

          Show
          Sivakumar Thyagarajan added a comment - The NPE in BeanManagerImpl is being tracked as part of GLASSFISH-14832
          Hide
          Sivakumar Thyagarajan added a comment -

          The NPE in BeanManagerImpl.java:729 is a known WELD issue (WELD-761 and we are tracking this
          in GLASSFISH-14832. So, closing this issue as a duplicate of that.

          Show
          Sivakumar Thyagarajan added a comment - The NPE in BeanManagerImpl.java:729 is a known WELD issue (WELD-761 and we are tracking this in GLASSFISH-14832 . So, closing this issue as a duplicate of that.

            People

            • Assignee:
              Sivakumar Thyagarajan
              Reporter:
              ljnelson
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: