Bug 724520 (BRMS-466)

Summary: DecisionTable added to KnowledgeAgent via change-set throws a NullPointerException
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Alessandro Lazarotti <alazarot>
Component: BRE (Expert, Fusion), ConfigurationAssignee: Nobody <nobody>
Status: VERIFIED --- QA Contact: Marek Baluch <mbaluch>
Severity: high Docs Contact:
Priority: high    
Version: 5.0.2, 5.1.0.ER3, BRMS 5.2.0.GACC: atangrin
Target Milestone: ---   
Target Release: BRMS 5.2.0.GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-466
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Decision table configuration was not being parsed to the overloaded KnowledgeBuilderImpl.add method resulting in a NullPointerException. This bug has been resolved and the NullPointerException is no longer thrown.
Story Points: ---
Clone Of: Environment:
JBoss Enterprise BRMS 5.0.2/5.1.0.ER3, JDK 1.6 sun/oracle, Fedora 12
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
ChangeSet.xml
none
KnowledgeAgentImpl.java.patch
none
SimpleDrools466.zip
none
SimpleDrools466.zip none

Description Alessandro Lazarotti 2010-11-26 19:14:20 UTC
Steps to Reproduce: Using a changeset.xml like the attached here, load using:

	private static KnowledgeBase readKnowledgeBase() throws Exception {
		final KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("kagent");		
		kagent.applyChangeSet(ResourceFactory.newClassPathResource("ChangeSet.xml")); 		
		KnowledgeBase kbase = kagent.getKnowledgeBase();
		return kbase;
	}
securitylevel_name: Public

When adding a change-set which contains a decision table to a KnowledgeAgent, is throws the exception:

Exception in thread "main" java.lang.NullPointerException
at org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:26)
at org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:19)
at org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:16)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:508)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:386)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:120)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109)
at org.drools.bug.AgentDecisionTableBug.main(AgentDecisionTableBug.java:12)

Comment 1 Alessandro Lazarotti 2010-11-26 19:16:41 UTC
Attachment: Added: ChangeSet.xml


Comment 2 Alessandro Lazarotti 2010-11-26 19:17:39 UTC
Link: Added: This issue is related to JBRULES-2230


Comment 3 Alessandro Lazarotti 2010-11-26 19:23:01 UTC
I tested the changes made by Michael Neal in Jira https://jira.jboss.org/browse/JBRULES-2230 and it's works.

Comment 4 Alessandro Lazarotti 2010-11-26 19:58:48 UTC
Patch based in tag BRMS-5.0.2-GA

Comment 5 Alessandro Lazarotti 2010-11-26 19:58:48 UTC
Attachment: Added: KnowledgeAgentImpl.java.patch


Comment 6 Len DiMaggio 2011-07-18 17:51:46 UTC
Seeing the same issue with the attached test and the 5.2 DEV2 build.

Comment 7 Len DiMaggio 2011-07-18 17:51:46 UTC
Attachment: Added: SimpleDrools466.zip


Comment 8 Len DiMaggio 2011-07-18 18:35:36 UTC
Attachment: Added: SimpleDrools466.zip


Comment 9 Tihomir Surdilovic 2011-08-25 01:22:21 UTC
Tested with 5.2.x branch and this error no longer happens. Used the test provided in https://issues.jboss.org/browse/JBRULES-2230.

Comment 10 lcarlon 2011-08-25 05:11:01 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
https://bugzilla.redhat.com/show_bug.cgi?id=724520

Decision table configuration was not being parsed to the overloaded KnowledgeBuilderImpl.add method resulting in a NullPointerException. This bug has been resolved and the NullPointerException is no longer thrown.

Comment 11 lcarlon 2011-09-14 04:28:09 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,3 +1 @@
-https://bugzilla.redhat.com/show_bug.cgi?id=724520
-
 Decision table configuration was not being parsed to the overloaded KnowledgeBuilderImpl.add method resulting in a NullPointerException. This bug has been resolved and the NullPointerException is no longer thrown.