Bug 1028534 - Classloader problems using BPMS with JBoss EAP bpms static modules layer
Classloader problems using BPMS with JBoss EAP bpms static modules layer
Status: CLOSED CURRENTRELEASE
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: jBPM Core (Show other bugs)
6.0.0
All All
urgent Severity high
: ER5
: 6.0.0
Assigned To: Roger Martínez
Marek Baluch
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-08 12:29 EST by Roger Martínez
Modified: 2014-08-06 16:12 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:12:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Roger Martínez 2013-11-08 12:29:56 EST
Description of problem: 

When using the BPMS webapp with EAP static modules distribution, the second time that user tries to build&deploy a process fails.

Version-Release number of selected component (if applicable): 

6.0.0-SNAPSHOT/6.1.1-SNAPSHOT

How reproducible:

Deploy the BPMS webapplication using the eap modules distribution. Try to build&deploy a process several times.

Steps to Reproduce:
1. Buid the BPMS - EAP modules distribution (kie-wb-distribution/kie-eap-integration)

2. Deploy the generated bpms static layer and the bpms war into a clean EAP installation

3. Run EAP

4. Go to project authoring

5. Open project editor

6. Click on "Build&deploy" -> it should be successful

7. Click on "Build&deploy" another time -> it fails

Actual results:

This is the relevant part of the exception:

13:43:28,338 ERROR [stderr] (http-localhost/127.0.0.1:8080-4) java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "org.jbpm:main" from local module loader @21d73ff5 (finder: local module finder @3aa7ff2e (roots: /home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules,/home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules/system/layers/bpms,/home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules/system/layers/base)). This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
13:43:28,339 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:76)
13:43:28,339 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.weld.Container.instance(Container.java:54)
13:43:28,339 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:67)
13:43:28,340 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
13:43:28,340 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.kie.services.impl.bpmn2.DataServiceItemDefinitionHandler$Proxy$_$$_WeldClientProxy.getValidParents(DataServiceItemDefinitionHandler$Proxy$_$$_WeldClientProxy.java)
13:43:28,340 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.core.xml.ExtensibleXmlParser.validate

Expected results:

Build & Deploy successful.
Additional info:
Comment 2 Roger Martínez 2013-11-08 12:31:13 EST
This is the whole stack trace:

13:43:28,338 ERROR [stderr] (http-localhost/127.0.0.1:8080-4) java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "org.jbpm:main" from local module loader @21d73ff5 (finder: local module finder @3aa7ff2e (roots: /home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules,/home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules/system/layers/bpms,/home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules/system/layers/base)). This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
13:43:28,339 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:76)
13:43:28,339 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.weld.Container.instance(Container.java:54)
13:43:28,339 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:67)
13:43:28,340 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
13:43:28,340 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.kie.services.impl.bpmn2.DataServiceItemDefinitionHandler$Proxy$_$$_WeldClientProxy.getValidParents(DataServiceItemDefinitionHandler$Proxy$_$$_WeldClientProxy.java)
13:43:28,340 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.core.xml.ExtensibleXmlParser.validate(ExtensibleXmlParser.java:438)
13:43:28,340 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.core.xml.ExtensibleXmlParser.startElement(ExtensibleXmlParser.java:386)
13:43:28,341 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
13:43:28,341 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
13:43:28,341 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
13:43:28,341 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
13:43:28,342 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
13:43:28,342 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
13:43:28,342 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
13:43:28,342 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
13:43:28,342 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
13:43:28,343 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
13:43:28,343 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
13:43:28,343 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
13:43:28,343 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.core.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:301)
13:43:28,343 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.core.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:180)
13:43:28,344 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.compiler.xml.XmlProcessReader.read(XmlProcessReader.java:46)
13:43:28,344 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.compiler.ProcessBuilderImpl.addProcessFromXml(ProcessBuilderImpl.java:262)
13:43:28,344 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.compiler.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:696)
13:43:28,344 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:736)
13:43:28,344 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
13:43:28,344 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
13:43:28,345 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl.findProcessId(BPMN2DataServiceImpl.java:197)
13:43:28,345 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl$Proxy$_$$_WeldClientProxy.findProcessId(BPMN2DataServiceImpl$Proxy$_$$_WeldClientProxy.java)
13:43:28,345 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.kie.services.impl.KModuleDeploymentService.deploy(KModuleDeploymentService.java:89)
13:43:28,345 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.kie.services.impl.KModuleDeploymentService$Proxy$_$$_WeldClientProxy.deploy(KModuleDeploymentService$Proxy$_$$_WeldClientProxy.java)
13:43:28,345 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.deploy(DeploymentManagerEntryPointImpl.java:110)
13:43:28,345 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.deploy(DeploymentManagerEntryPointImpl.java:100)
13:43:28,346 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.process(DeploymentManagerEntryPointImpl.java:242)
13:43:28,346 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl$Proxy$_$$_WeldClientProxy.process(DeploymentManagerEntryPointImpl$Proxy$_$$_WeldClientProxy.java)
13:43:28,346 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.guvnor.common.services.builder.BuildServiceImpl.buildAndDeploy(BuildServiceImpl.java:104)
13:43:28,346 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.buildAndDeploy(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)
13:43:28,346 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:43:28,347 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:43:28,347 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:43:28,347 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at java.lang.reflect.Method.invoke(Method.java:606)
13:43:28,347 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.io.AbstractRPCMethodCallback.invokeMethodFromMessage(AbstractRPCMethodCallback.java:48)
13:43:28,347 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.io.ValueReplyRPCEndpointCallback.callback(ValueReplyRPCEndpointCallback.java:22)
13:43:28,347 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.io.RemoteServiceCallback.callback(RemoteServiceCallback.java:54)
13:43:28,348 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.cdi.server.CDIExtensionPoints$3.callback(CDIExtensionPoints.java:509)
13:43:28,348 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.DeliveryPlan.deliver(DeliveryPlan.java:47)
13:43:28,348 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.ServerMessageBusImpl.sendGlobal(ServerMessageBusImpl.java:284)
13:43:28,348 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.SimpleDispatcher.dispatchGlobal(SimpleDispatcher.java:46)
13:43:28,348 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:92)
13:43:28,348 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:109)
13:43:28,349 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.errai.bus.server.servlet.DefaultBlockingServlet.doPost(DefaultBlockingServlet.java:140)
13:43:28,349 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
13:43:28,349 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
13:43:28,349 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
13:43:28,349 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
13:43:28,349 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
13:43:28,350 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
13:43:28,350 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
13:43:28,350 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
13:43:28,350 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
13:43:28,350 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
13:43:28,350 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70)
13:43:28,351 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
13:43:28,351 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
13:43:28,351 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266)
13:43:28,351 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
13:43:28,351 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
13:43:28,351 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
13:43:28,352 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
13:43:28,352 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:499)
13:43:28,352 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
13:43:28,352 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
13:43:28,352 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
13:43:28,353 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
13:43:28,353 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
13:43:28,353 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:408)
13:43:28,353 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
13:43:28,353 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
13:43:28,353 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
13:43:28,354 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
13:43:28,354 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
13:43:28,354 ERROR [stderr] (http-localhost/127.0.0.1:8080-4)   at java.lang.Thread.run(Thread.java:724)
13:43:28,355 ERROR [org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl] (http-localhost/127.0.0.1:8080-4) Error: unable to parse xml : Exception class java.lang.IllegalStateException : JBAS016071: Singleton not set for ModuleClassLoader for Module "org.jbpm:main" from local module loader @21d73ff5 (finder: local module finder @3aa7ff2e (roots: /home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules,/home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules/system/layers/bpms,/home/romartin/development/temp/modules/EAP-6.1.1/jboss-eap-6.1/modules/system/layers/base)). This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
13:43:28,358 ERROR [org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl] (http-localhost/127.0.0.1:8080-4) Deployment of unit org.jbpm:HR:1.0 failed: null: org.jbpm.console.ng.bd.exception.DeploymentException
        at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.deploy(DeploymentManagerEntryPointImpl.java:116) [jbpm-console-ng-business-domain-backend-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.deploy(DeploymentManagerEntryPointImpl.java:100) [jbpm-console-ng-business-domain-backend-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.process(DeploymentManagerEntryPointImpl.java:242) [jbpm-console-ng-business-domain-backend-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl$Proxy$_$$_WeldClientProxy.process(DeploymentManagerEntryPointImpl$Proxy$_$$_WeldClientProxy.java) [jbpm-console-ng-business-domain-backend-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.guvnor.common.services.builder.BuildServiceImpl.buildAndDeploy(BuildServiceImpl.java:104) [guvnor-project-builder-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.buildAndDeploy(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java) [guvnor-project-builder-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_40]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_40]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_40]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
        at org.jboss.errai.bus.server.io.AbstractRPCMethodCallback.invokeMethodFromMessage(AbstractRPCMethodCallback.java:48) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.io.ValueReplyRPCEndpointCallback.callback(ValueReplyRPCEndpointCallback.java:22) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.io.RemoteServiceCallback.callback(RemoteServiceCallback.java:54) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.cdi.server.CDIExtensionPoints$3.callback(CDIExtensionPoints.java:509) [errai-weld-integration-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.DeliveryPlan.deliver(DeliveryPlan.java:47) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.ServerMessageBusImpl.sendGlobal(ServerMessageBusImpl.java:284) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.SimpleDispatcher.dispatchGlobal(SimpleDispatcher.java:46) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:92) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:109) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at org.jboss.errai.bus.server.servlet.DefaultBlockingServlet.doPost(DefaultBlockingServlet.java:140) [errai-bus-2.4.1.Final.jar:2.4.1.Final]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.2.1.Final.jar:3.2.1.Final]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.2.1.Final.jar:3.2.1.Final]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70) [jbpm-designer-backend-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266) [uberfire-security-server-0.3.0-SNAPSHOT.jar:0.3.0-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:499) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
        at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:408) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
        at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
Caused by: java.lang.NullPointerException
        at org.jbpm.kie.services.impl.KModuleDeploymentService.deploy(KModuleDeploymentService.java:90) [jbpm-kie-services-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.jbpm.kie.services.impl.KModuleDeploymentService$Proxy$_$$_WeldClientProxy.deploy(KModuleDeploymentService$Proxy$_$$_WeldClientProxy.java) [jbpm-kie-services-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        at org.jbpm.console.ng.bd.backend.server.DeploymentManagerEntryPointImpl.deploy(DeploymentManagerEntryPointImpl.java:110) [jbpm-console-ng-business-domain-backend-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
        ... 50 more
Comment 3 Roger Martínez 2013-11-08 12:41:13 EST
After analyzing the issue, this is the failure reason:

There are some points in the code where the context classloader instance for the current thread is changed. For example in class org.jbpm.compiler.ProcessBuilderImpl:254.

This may cause problems with weld deployments and EAP static modules.

When using BPMS without the bpms static modules layer, all jbpm/drools core classes are loaded by the webapp classloader.

When using EAP bpms static modules layer, the jbpm/drools core jars are located into the EAP static modules structure. So the classloader for these classes is not the webapp one, each module has its own classloader.

BTW, when using Weld deployments and EAP static modules, if a bean scope is set to singleton, this singleton is stored for given a classpath (See org.jboss.as.weld.services.ModuleGroupSingletonProvider.TCCLSingleton#get). So, trying to obtain a singleton from different classloaders fails.
Comment 4 Roger Martínez 2013-11-08 14:51:27 EST
Removing lines like "Thread.currentThread().setContextClassLoader(...);" it works, but I'm not sure if these can be removed as well..

This issue is in current discussion in bsig mail group...
Comment 5 Roger Martínez 2013-11-12 12:32:00 EST
After discussing this issue with Kris, the idea is not only fixing the code in ProcessBuilderImpl. We should be careful with changing classsloaders when the application is deployed using static eap modules, it can produce potential errors.


So, I will analyze all places in the code where thread classloader is changed, make an overview and fix all possible ones.
Comment 6 Roger Martínez 2013-11-12 15:14:30 EST
After a first review iteration in all droolsjbpm code, seems that the important classes to fix are only two:

1.- ./drools/kie-ci/src/main/java/org/kie/scanner/embedder/MavenEmbedder.java

2.- ./jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessBuilderImpl.java
Comment 7 Roger Martínez 2013-11-13 07:08:51 EST
After checking code for MavenEmbedder.java with mfusco, the code seems correct. I have tested it and its working fine.

So the only modifications are into class ProcessBuilderImpl.java. After deleting classloader setting lines the app builds and deploys successful. Module tests are successfull too.

Commit 6.0.X
============
https://github.com/droolsjbpm/jbpm/commit/fc0953ab2bc3000816c901d39b8cdb074b4fe1dd


Commit master
=============
https://github.com/droolsjbpm/jbpm/commit/2fb49d6932582712b917e5ca8531afe59fc2dac4
Comment 8 Roger Martínez 2013-11-13 07:17:14 EST
Please, ensure mfusco commit is added to the new tag, as it's important about modules too.

- https://github.com/droolsjbpm/drools/commit/0fa253fecbe65524c7efb8c011a318d3dcb3fe05
Comment 9 Roger Martínez 2013-11-13 07:23:17 EST
Sorry, msfuco commit for 6.0.X is this one:

https://github.com/droolsjbpm/drools/commit/d582424d4c6861b05ac46b45a5bbc93c815cd961

The one in last comment was for master branch.
Comment 10 Roger Martínez 2013-11-14 13:37:03 EST
I have found another issue related with classloaders and I have commited the fix.

Commit on 6.0.X -> https://github.com/droolsjbpm/kie-wb-distributions/commit/2e458446a191542a897e18da4199e12b3f3cd9ac

Commit on master -> https://github.com/droolsjbpm/kie-wb-distributions/commit/eba09b69966c83afccbbcc5985e97f571d597b48

This commits should be added to new tag as well.

Thx
Comment 11 Marek Baluch 2013-12-09 11:51:29 EST
Verified on ER5.

Built the HR project a few times and all is fine.

Note You need to log in before you can comment on or make changes to this bug.