13 Replies Latest reply on Nov 2, 2015 2:29 AM by Martin Kouba

    NPE in JandexFileSystemBeanArchiveHandler using Weld 2.2.14 on vmware tcserver

    Leo Mekenkamp Newbie

      Hi all,

       

      We have got an application that is running ok on a Tomcat 7 instance. When we try to deploy that application on a vmware tcserver instance, the application throws an exception:

       

      15-Sep-2015 15:03:33.016 SEVERE [localhost-startStop-4] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:

      org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/icb]]

              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

              at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)

              at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

              at java.util.concurrent.FutureTask.run(FutureTask.java:262)

              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:745)

      Caused by: java.lang.NullPointerException

              at org.jboss.weld.environment.deployment.discovery.jandex.JandexFileSystemBeanArchiveHandler.handle(JandexFileSystemBeanArchiveHandler.java:43)

              at org.jboss.weld.environment.deployment.discovery.AbstractDiscoveryStrategy.performDiscovery(AbstractDiscoveryStrategy.java:91)

              at org.jboss.weld.environment.servlet.WeldServletLifecycle.createDeployment(WeldServletLifecycle.java:238)

              at org.jboss.weld.environment.servlet.WeldServletLifecycle.initialize(WeldServletLifecycle.java:116)

              at org.jboss.weld.environment.servlet.EnhancedListener.onStartup(EnhancedListener.java:61)

              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)

              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

              ... 10 more

       

      I connected a debugger and found out that on line 42 in JandexFileSystemBeanArchiveHandler, the super.handle(path) method is called with "WEB-INF/classes" as argument. The FileSystemBeanArchiveHandler, being the superclass of JandexFileSystemBeanArchiveHandler, returns a null. This causes an NPE.

       

      My question: is there a way to disable Jandex handling in Weld, or is there another way to work around this bug?

       

      I found a reference to a similar question on stackoverflow.com, but that question has been deleted, unfortunately. This bug seems quite rare.

       

      cheers,

      --L