Bug 724237 (BRMS-181) - StatelessKnowledgeSessions created by KnowledgeAgent causes NullPointerException when used in a pipeline
Summary: StatelessKnowledgeSessions created by KnowledgeAgent causes NullPointerExcept...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: BRMS-181
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: unspecified
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: 5.0.1
Assignee: Mark Proctor
QA Contact:
URL: http://jira.jboss.org/jira/browse/BRM...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-07 15:28 UTC by nwallace
Modified: 2009-10-05 08:36 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
5.0.1.SNAPSHOT for May 12, 2009
Last Closed: 2009-09-01 12:29:19 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker BRMS-181 0 None None None Never

Description nwallace 2009-07-07 15:28:28 UTC
Date of First Response: 2009-09-10 01:37:38
securitylevel_name: Public

This issue is related to this thread on the user-list:  http://www.mail-archive.com/rules-users@lists.jboss.org/msg08770.html

I'm getting a NullPointerException when I insert an object into
the pipeline using 5.0.1.SNAPSHOT from May 12, 2009:
java.lang.NullPointerException
        at 
org.drools.runtime.pipeline.impl.StatelessKnowledgeSessionPipelineImpl.insert(StatelessKnowledgeSessionPipelineImpl.java:24)

It looks like StatelessKnowledgeSession's ruleBase is null when created by the KnowledgeAgent, which poses a problem since StatelessKnowledgeSessionPipelineImpl invokes getRootClassLoader() on the session's ruleBase.

Here's what I'm doing:
StatelessKnowledgeSession ksession = kagent.newStatelessKnowledgeSession();
Pipeline pipeline =
PipelineFactory.newStatelessKnowledgeSessionPipeline(ksession);
pipeline.setReceiver(messageTransformer);
pipeline.insert(message);  // NPE here

I'll attach a patch to KnowledgeAgentTest containing a failing test case.

Comment 1 nwallace 2009-07-07 15:29:50 UTC
Link: Added: This issue is related to JBRULES-2090


Comment 2 nwallace 2009-09-01 12:29:19 UTC
Fix in place.

Comment 3 David Le Sage 2009-09-10 05:37:38 UTC
For documenting this in the Release Notes, can you please confirm the following and fill in the missing information. Dot point explanations are fine:

The CAUSE (what was actually broken)
 * 

CONSEQUENCES of the bug (how it impacts users.)
 * The StatelessKnowledgeSessions created by the Knowledge Agent were, when used in pipelines, causing  null pointer exceptions. 

The FIX (what was changed to eliminate this bug) and 
 * The Agent is now checked to ensure that the latest version of the rulebase has been set.

RESULTS of the fix (what now happens for users.)
 * 

Comment 4 Dana Mison 2009-10-05 05:45:07 UTC
added to the 5.0.CP01 release notes as resolved:

JBRULES-2090
StatelessKnowledgeSessions created by KnowledgeAgent could throw a Null Pointer Exception if used in a pipeline. This because KnowledgeAgent creates the StatelessKnowlegeSession with a null ruleBase. The Agent is now checked to ensure that the latest version of the rule base has been set.


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