Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1071213

Summary: There's already another KieContainer created from a different ClassLoader
Product: [Retired] JBoss BRMS Platform 6 Reporter: Ivo Bek <ibek>
Component: Business CentralAssignee: Alexandre Porcelli <porcelli>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.1CC: etirelli, kverlaen, mbiarnes, rrajasek
Target Milestone: CR1   
Target Release: 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:59:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
server log
none
springapp.war
none
springframework.zip none

Description Ivo Bek 2014-02-28 09:51:01 UTC
Description of problem:

When I redeploy Business Central, I will get the following exception:

IllegalStateException: There's already another KieContainer created from a different ClassLoader
	at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:82)
	at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:67)
	at org.drools.compiler.cdi.KieCDIExtension.init(KieCDIExtension.java:74)
	at org.drools.compiler.cdi.KieCDIExtension.processInjectionTarget(KieCDIExtension.java:81)

I get this exception also when I want to deploy my own application which uses a kie container, so it is not possible to use both at the same time.

I suggest to look at the modules which have changed a lot.

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


How reproducible:


Steps to Reproduce:
1. Have a clear installation of BPMS 6.0.1.ER1
2. Start BPMS
3. Undeploy Business central
4. Deploy Business central back
5. See the exceptions in the server log

Actual results:


Expected results:


Additional info:

Comment 1 Ivo Bek 2014-02-28 09:51:53 UTC
Created attachment 868934 [details]
server log

Comment 2 Mario Fusco 2014-02-28 15:11:55 UTC
Alexandre already fixed a duplicate of this issue. Reassigning to him to double check that is the same thing and eventually close.

Comment 3 Alexandre Porcelli 2014-02-28 15:14:03 UTC
This issue was already reported by #1051769 - so here is the fix:

(master) http://github.com/droolsjbpm/drools/commit/758624fa4
(6.0.x) http://github.com/droolsjbpm/drools/commit/30d9915d2

Comment 5 Ivo Bek 2014-03-04 09:28:32 UTC
Verified in BPMS 6.0.1.ER2

It is possible to redeploy Business central and also have an own kie application together with Business central.

Comment 6 Ivo Bek 2014-03-11 08:55:04 UTC
I have to reopen this issue because the problem is still there. Yes, it is possible to redeploy Business central. Also it is possible to have own kie application together with Business central.

The problem is that it is not possible to redeploy own kie spring application. I get:

Caused by: java.lang.IllegalStateException: There's already another KieContainer created from a different ClassLoader
	at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:83) [drools-compiler-6.0.2-redhat-4.jar:6.0.2-redhat-4]
	at org.drools.compiler.kie.builder.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:68) [drools-compiler-6.0.2-redhat-4.jar:6.0.2-redhat-4]
	at org.kie.spring.KieSpringUtils.<clinit>(KieSpringUtils.java:51) [kie-spring-6.0.2-redhat-4.jar:6.0.2-redhat-4]
	... 18 more


I will attach the spring application. To reproduce the issue, all you need to do is:

1) create spring module - just extract springframework.zip into modules/system/layers/base/org
2) start BPMS 6.0.1.ER2
3) deploy springapp.war
4) undeploy springapp.war
5) deploy springapp.war once again
6) see the exception above

Comment 7 Ivo Bek 2014-03-11 08:55:54 UTC
Created attachment 873020 [details]
springapp.war

Comment 8 Ivo Bek 2014-03-11 08:57:31 UTC
Created attachment 873021 [details]
springframework.zip

Comment 9 Alexandre Porcelli 2014-03-12 16:57:03 UTC
Fix on spring integration:

(6.0.x) http://github.com/droolsjbpm/droolsjbpm-integration/commit/99ea65b52
(master) http://github.com/droolsjbpm/droolsjbpm-integration/commit/72f9388e6

btw: you'll have to update springapp.war with most recent spring integration in order be able to test it.

Comment 10 Michael 2014-03-17 16:48:00 UTC
Ticket cherry-picked into 6.0.1.CR1. 
Commit: 143e86a593e9bc8650716c95e1aa9afed204d4c1

Comment 11 Alexandre Porcelli 2014-03-17 17:11:03 UTC
Fix on jbpm RuntimeEnvironmentBuilder:

(6.0.x) http://github.com/droolsjbpm/jbpm/commit/b8ae2baf2
(master) http://github.com/droolsjbpm/jbpm/commit/206a63482

Comment 12 Michael 2014-03-17 17:22:25 UTC
Ticket cherry-picked into 6.0.1.CR1. 
Commit: 755f30801b0090d797e7d5734e4228d36f028f1b

Comment 13 Ivo Bek 2014-03-25 08:51:41 UTC
Verified in BPMS 6.0.1.CR1