Bug 811745 - NPE when used Event types + rules with sliding window + package compiled by BRM (Guvnor)
NPE when used Event types + rules with sliding window + package compiled by B...
Status: MODIFIED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor) (Show other bugs)
BRMS 5.2.0.GA
Unspecified Unspecified
urgent Severity urgent
: ---
: ---
Assigned To: manstis
Lukáš Petrovický
:
Depends On:
Blocks: 814409 812707
  Show dependency treegraph
 
Reported: 2012-04-11 16:50 EDT by Alessandro Lazarotti
Modified: 2012-05-14 08:23 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 814409 (view as bug list)
Environment:
Last Closed:
Type: Support Patch
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
repository export containing a test scenario reproducing the issue (182.16 KB, application/zip)
2012-04-11 16:53 EDT, Alessandro Lazarotti
no flags Details
based drl file (369 bytes, application/octet-stream)
2012-04-23 17:57 EDT, Alessandro Lazarotti
no flags Details
pojo model (625 bytes, application/x-java-archive)
2012-04-23 17:59 EDT, Alessandro Lazarotti
no flags Details
test scenario printscreen (136.09 KB, image/png)
2012-04-23 18:01 EDT, Alessandro Lazarotti
no flags Details
pkg generated by guvnor (4.45 KB, application/vnd.apple.installer+xml)
2012-04-24 11:39 EDT, Alessandro Lazarotti
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBRULES-3145 Major Closed Types declared in DRL with no fields are not included in KnowledgeBase compiled by ChangeSet 2014-03-19 01:12:05 EDT

  None (edit)
Description Alessandro Lazarotti 2012-04-11 16:50:39 EDT
Packages compiled by BRM (Guvnor) ignore Event types, so if a rule uses sliding window a NPE is throwed:
h
java.lang.NullPointerException
at org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:56)
at org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:80)
at org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:65)
at org.drools.common.NamedEntryPoint.createHandle(NamedEntryPoint.java:705)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:282)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at john.DroolsError.runRules(DroolsError.java:48)
at john.DroolsError.main(DroolsError.java:40) 

Packages compiled by BRM (Guvnor) ignore Event types, so if a rule uses sliding window a NPE is throwed:

java.lang.NullPointerException
at org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:56)
at org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:80)
at org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:65)
at org.drools.common.NamedEntryPoint.createHandle(NamedEntryPoint.java:705)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:282)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at john.DroolsError.runRules(DroolsError.java:48)
at john.DroolsError.main(DroolsError.java:40) 

That does not happen if used KnowledgeBuilder and a regular drl file instead of KnowledgeAgent + package binaries from Guvnor.
It can be checked by test scenarios as well. Attached here a repository that reproduces this issue, there is a test scenario in the package "cep" which simulate this situation.
Comment 1 Alessandro Lazarotti 2012-04-11 16:53:13 EDT
Created attachment 576889 [details]
repository export containing a test scenario reproducing the issue
Comment 2 Alessandro Lazarotti 2012-04-23 17:57:24 EDT
Created attachment 579703 [details]
based drl file
Comment 3 Alessandro Lazarotti 2012-04-23 17:59:46 EDT
Created attachment 579704 [details]
pojo model
Comment 4 Alessandro Lazarotti 2012-04-23 18:01:26 EDT
Created attachment 579705 [details]
test scenario printscreen
Comment 7 Alessandro Lazarotti 2012-04-24 11:39:41 EDT
Created attachment 579896 [details]
pkg generated by guvnor
Comment 8 Edson Tirelli 2012-04-24 14:36:30 EDT
We found the problem and discussed the solutions with the Guvnor team. Expect to have this fixed over the next couple days, as the Guvnor team would like to assess the whole impact it will have on existing deployments before delivering.
Comment 9 Edson Tirelli 2012-04-25 10:07:23 EDT
The core engine fix is committed and published. Michael is now making sure the guvnor part of the fix is correct and he will let us know when it is done. The commits for the core engine are:


[drools] etirelli pushed 1 new commit to 5.2.x: https://github.com/droolsjbpm/drools/commit/611c993305ffbe1d0eb846351d58dc626d50a3cf
[drools/5.2.x] JBRULES-3145 BZ-811745: improving the agent code to handle different types of serialized packages - Edson Tirelli
[drools] etirelli pushed 1 new commit to 5.3.x: https://github.com/droolsjbpm/drools/commit/5802f2e7b784712eb85dba6d0dcf4d1443f0e434
[drools/5.3.x] JBRULES-3145 BZ-811745: improving the agent code to handle different types of serialized packages - Edson Tirelli
[drools] etirelli pushed 1 new commit to 5.4.x: https://github.com/droolsjbpm/drools/commit/0ba64ba4d15b7827a84af617dfc2ed918deb52de
[drools/5.4.x] JBRULES-3145 BZ-811745: improving the agent code to handle different types of serialized packages - Edson Tirelli
[drools] etirelli pushed 1 new commit to master: https://github.com/droolsjbpm/drools/commit/5fadf55cf97c0d6a9f3ecddfb29e316f7f3f4b8f
[drools/master] JBRULES-3145 BZ-811745: improving the agent code to handle different types of serialized packages - Edson Tirelli
Comment 10 JBoss JIRA Server 2012-04-25 17:38:18 EDT
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira JBRULES-3145 to Resolved
Comment 11 JBoss JIRA Server 2012-04-25 17:38:33 EDT
Edson Tirelli <ed.tirelli@gmail.com> updated the status of jira JBRULES-3145 to Closed
Comment 12 manstis 2012-04-26 09:52:09 EDT
Guvnor fixes made to branches 5.2.x, 5.3.x, 5.4.x and master.
Comment 13 Lukáš Petrovický 2012-05-02 17:43:00 EDT
Alessandro, could you please explain what is the difference between this one and bug 814409?
Comment 14 Alessandro Lazarotti 2012-05-03 00:34:59 EDT
Hi Lukas. Both is about the same issue.
This BZ has the goal to fix the issue on the next BRMS 5.2 Roll-Up Patch (look 	812707 in the "Blocks" list ). 

The bug 814409 is a clone of this, to cherry pick the fix to BRMS 5.3. When GSS needs a patch.

When GSS needs a support patch, we need to guarantee that it will be fixed on: 
1) Customer version (sent by one-off or roll-up) - Bug 811745 
2) Next product version - Bug 814409 
3) Upstream - JBRULES-3145

Regards
Comment 15 Alessandro Lazarotti 2012-05-03 00:38:32 EDT
Hi Lukas. Both are about the same issue.
This BZ has the goal to fix the issue on the next BRMS 5.2 Roll-Up Patch (look 
812707 in the "Blocks" list ). 

The bug 814409 is a clone of this, to cherry pick the fix to BRMS 5.3.

When GSS needs a support patch, we need to guarantee that it will be fixed on: 
1) Customer version (sent by one-off or roll-up) - Bug 811745 
2) Next product version - Bug 814409 
3) Upstream - JBRULES-3145

Regards

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