Uploaded image for project: 'XBean'
  1. XBean
  2. XBEAN-326

NullpointerException in BundleAssignableClassFinder

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 4.17
    • 4.19
    • finder
    • None

    Description

      I load a WAR file into Karaf and the org.ops4j.pax.wab JettyServerWrapper starts a scan.
      The BundleAssignableClassFinder starts method isClassAcceptable

      then 

      if (this.wiredImportedPackageNames.contains(this.toASMStylePackageName(superClassName)

      is called with superClassName == null

      This happens if my WAR file contains an embedded dependency that contains a module-info.class file which is of course the file that triggers the nullpointer.

      This is the stacktrace in my apache karaf distribution:

      java.lang.NullPointerException
             at org.apache.xbean.finder.BundleAssignableClassFinder.toASMStylePackageName(BundleAssignableClassFinder.java:257)
             at org.apache.xbean.finder.BundleAssignableClassFinder.isClassAcceptable(BundleAssignableClassFinder.java:111)
             at org.apache.xbean.osgi.bundle.util.BundleClassFinder.scanZip(BundleClassFinder.java:280)
             at org.apache.xbean.osgi.bundle.util.BundleClassFinder.scanBundleClassPath(BundleClassFinder.java:237)
             at org.apache.xbean.osgi.bundle.util.BundleClassFinder.find(BundleClassFinder.java:112)
             at org.ops4j.pax.web.utils.ServletContainerInitializerScanner.scanBundles(ServletContainerInitializerScanner.java:118)
             at org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.addContext(JettyServerWrapper.java:294)
             at org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.getOrCreateContext(JettyServerWrapper.java:219)
             at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.getContext(JettyServerImpl.java:312)
             at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.getContext(ServerControllerImpl.java:374)
             at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.getContext(ServerControllerImpl.java:187)
             at org.ops4j.pax.web.service.internal.HttpServiceStarted.begin(HttpServiceStarted.java:1249)
             at org.ops4j.pax.web.service.internal.HttpServiceProxy.begin(HttpServiceProxy.java:451)
             at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:183)
             at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:621)
             at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:228)
             at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:173)
             at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:129)
             at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
             at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
             at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
             at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
             at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
             at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)
             at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:98)
             at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:217)
             at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:172)
             at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:59)
             at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender.lambda$createExtension$0(AbstractExtender.java:277)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
             at java.util.concurrent.FutureTask.run(FutureTask.java:266)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
             at java.lang.Thread.run(Thread.java:748)

      Attachments

        1. xbean-362.diff
          0.8 kB
          Matthias Koch

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            mattkoch Matthias Koch
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: