Bug 976498

Summary: KieBase including resources from other KieBase fails to compile when it declares a fact
Product: [Retired] JBoss BRMS Platform 6 Reporter: Marek Winkler <mwinkler>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: lpetrovi, mfusco, rzhang
Target Milestone: DR6Keywords: Regression, TestBlocker
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:17:00 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:

Description Marek Winkler 2013-06-20 16:57:10 UTC
Description of problem:

When a KieBase is defined in kmodule.xml in a way that it includes resources from other KieBase, and the included resources contain a DRL defining a fact, the KieBuilder fails with the following message:

2013-06-20 18:41:39,605 [main] ERROR Unable to build KieBaseModel:defaultKBase
New declaration of org.drools.compiler.integrationtests.CancelFact can't declare new fields

The declaration of CancelFact is located in one DRL file only. The same DRL file is used by both defined KieBases. Please see the attached pull request with reproducer for details.

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

Drools 6.0.0-SNAPSHOT
very likely Drools 6.0.0.Beta4 (not released yet)

This worked fine with Drools 6.0.0.Beta3, so it seems to be a regression.

How reproducible:

Run the test case in attached pull request.

Actual results:

The KieBase does not compile.

Expected results:

The KieBase compiles, test succeeds.

Comment 1 Marek Winkler 2013-06-20 17:00:04 UTC
Pull request with the reproducer: https://github.com/droolsjbpm/drools/pull/216

Comment 2 Marek Winkler 2013-07-01 15:16:20 UTC
Adding TestBlocker because large number of tests failing during their initialization complicates regression testing.

Comment 3 Mario Fusco 2013-07-02 09:09:13 UTC
Fixed by building each KieBase with a different ClassLoader,

Comment 4 Marek Winkler 2013-07-02 11:12:48 UTC
*** Bug 980378 has been marked as a duplicate of this bug. ***

Comment 5 Marek Winkler 2013-08-08 14:55:49 UTC
Verified on 6.0.0.Beta5.