Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-6322

Deployment of EAR with multiple WARs fails with NPE in Camunda JBoss Subsystem

XMLWordPrintable

      Deploying an EAR file containing Skinny-WARs (multiple WARs with shared libs in the EAR) to JBoss (AS7), leads sometimes to a NullPointerException.
      The problem is, that the class org.camunda.bpm.container.impl.jboss.deployment.processor.ModuleDependencyProcessor.java adds system dependencies to OTHER sibling subdeployment-units. JBoss starts the subdeployment for each WAR file inside the EAR as subdeployment in parallel. This causes concurrency problems, because each WAR subdeployment adds the camunda libs as system dependencies to all other WARs.
      The access to ModuleSpecification.addSystemDependency(), which adds the camunda libraries, is not synchronized and finally leads to an inconsistent system-dependency-list containing null values. As a result JBoss throws some times later a NPE:

      08:07:58,214 ERROR [MSC service thread 1-47] org.jboss.msc.service.ServiceControllerImpl$StartTask.startFailed:1987 - MSC000001: Failed to start service jboss.deployment.subunit."GUIWF.ear"."CCP_ConfCalc.jar".CONFIGURE_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."GUIWF.ear"."CCP_ConfCalc.jar".CONFIGURE_MODULE: JBAS018733: Verarbeitung von Phase CONFIGURE_MODULE von subdeployment "CCP_ConfCalc.jar" of deployment "GUIWF.ear" fehlgeschlagen
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913)
      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.as.server.deployment.module.ModuleSpecProcessor.createDependencies(ModuleSpecProcessor.java:237)
      at org.jboss.as.server.deployment.module.ModuleSpecProcessor.createModuleService(ModuleSpecProcessor.java:182)
      at org.jboss.as.server.deployment.module.ModuleSpecProcessor.deployModuleSpec(ModuleSpecProcessor.java:116)
      at org.jboss.as.server.deployment.module.ModuleSpecProcessor.deploy(ModuleSpecProcessor.java:79)
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)
      ... 5 more

      The same problem was reported and fixed for the JBoss JSFDependencyProcessor: https://issues.jboss.org/browse/WFLY-2496

      We are currently working with camunda release 7.3, but as I looked in the sources, it should still be open.

      Solution?
      In general, it seems not to be expected, that one Subdeployment unit adds system dependencies to another Subdeployment unit. So I can not present a clean solution, but adding a "synchronized" to the method ModuleDependencyProcessor.addSystemDependency() should decrease the concurrency possibility.

        This is the controller panel for Smart Panels app

              meyer Daniel Meyer
              feri Ferenc Hechler
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: