jersey
  1. jersey
  2. JERSEY-2419

NPE in CdiComponentProvider caused by missing null pointer check (Class.getPackage() could return null)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.7
    • Component/s: containers
    • Labels:
      None

      Description

      This was revealed when integrating into Jersey 2.6 into GFv4 trunk.

      Following is the important part of appropriate stack trace:

      [exec] remote failure: Error occurred during deployment: Exception while loading the app : CDI definition failure:Exception List with 1 exceptions:
           [exec] Exception 0 :
           [exec] java.lang.NullPointerException
           [exec] 	at org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.isJerseyOrDependencyType(CdiComponentProvider.java:566)
           [exec] 	at org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.filterHk2InjectionPointsOut(CdiComponentProvider.java:479)
           [exec] 	at org.glassfish.jersey.gf.cdi.internal.CdiComponentProvider.processInjectionTarget(CdiComponentProvider.java:440)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           [exec] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
           [exec] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           [exec] 	at java.lang.reflect.Method.invoke(Method.java:601)
           [exec] 	at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
           [exec] 	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:274)
           [exec] 	at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
           [exec] 	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:261)
           [exec] 	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:240)
           [exec] 	at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:171)
           [exec] 	at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:130)
           [exec] 	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:104)
           [exec] 	at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
           [exec] 	at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
           [exec] 	at org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget.fire(AbstractProcessInjectionTarget.java:32)
           [exec] 	at org.jboss.weld.bootstrap.events.ContainerLifecycleEvents.fireProcessInjectionTarget(ContainerLifecycleEvents.java:177)
           [exec] 	at org.jboss.weld.bootstrap.AbstractBeanDeployer.fireBeanEvents(AbstractBeanDeployer.java:147)
           [exec] 	at org.jboss.weld.bootstrap.AbstractBeanDeployer.fireBeanEvents(AbstractBeanDeployer.java:137)
           [exec] 	at org.jboss.weld.bootstrap.BeanDeployer.deploy(BeanDeployer.java:335)
           [exec] 	at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:275)
           [exec] 	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:515)
           [exec] 	at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:213)
           [exec] 	at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
           [exec] 	at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
           [exec] 	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:496)
           [exec] 	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
           [exec] 	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
      

        Issue Links

          Activity

          Hide
          Jakub Podlesak added a comment -

          Fix for JERSEY-2358 introduced this NPE.

          Show
          Jakub Podlesak added a comment - Fix for JERSEY-2358 introduced this NPE.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: