Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-380

NPE in PartialBeanLifecycle if javassist not on classpath

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4
    • 0.5
    • PartialBean
    • None

    Description

      I am getting

      java.lang.NullPointerException
      at org.apache.deltaspike.partialbean.impl.PartialBeanLifecycle.<init>(PartialBeanLifecycle.java:73)
      at org.apache.deltaspike.partialbean.impl.PartialBeanBindingExtension.createPartialBean(PartialBeanBindingExtension.java:142)
      at org.apache.deltaspike.partialbean.impl.PartialBeanBindingExtension.createBeans(PartialBeanBindingExtension.java:109)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
      at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:274)
      at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
      at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:261)
      at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:240)
      at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:171)
      at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:130)
      at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:104)
      at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
      at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
      at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:58)
      at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:516)
      at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:64)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1974)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1907)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)

      when javassist is not on the classpath. The corresponding code is:

      Object proxyFactory = ClassUtils.tryToInstantiateClassForName("javassist.util.proxy.ProxyFactory");

      Method setSuperclassMethod = proxyFactory.getClass().getDeclaredMethod("setSuperclass", Class.class);

      proxyFactory is null when javassist is not on classpath.

      Also note that tests for partial beans do not bundle javassist within the test archive which they should! Otherwise those tests won't pass on a container that does not implicitly add javassist to the classpath (e.g. WildFly).

      Attachments

        1. DELTASPIKE-380.patch
          1 kB
          Jozef Hartinger

        Issue Links

          Activity

            People

              struberg Mark Struberg
              jharting Jozef Hartinger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: