Bug 811745 - NPE when used Event types + rules with sliding window + package compiled by BRM (Guvnor)
Summary: NPE when used Event types + rules with sliding window + package compiled by B...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor)
Version: BRMS 5.2.0.GA
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: ---
Assignee: manstis
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 812707 814409
TreeView+ depends on / blocked
 
Reported: 2012-04-11 20:50 UTC by Alessandro Lazarotti
Modified: 2025-02-10 03:19 UTC (History)
0 users

Fixed In Version:
Clone Of:
: 814409 (view as bug list)
Environment:
Last Closed: 2025-02-10 03:19:34 UTC
Type: Support Patch
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBRULES-3145 0 Major Closed Types declared in DRL with no fields are not included in KnowledgeBase compiled by ChangeSet 2014-03-19 05:12:05 UTC

Description Alessandro Lazarotti 2012-04-11 20:50:39 UTC
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 20:53:13 UTC
Created attachment 576889 [details]
repository export containing a test scenario reproducing the issue

Comment 2 Alessandro Lazarotti 2012-04-23 21:57:24 UTC
Created attachment 579703 [details]
based drl file

Comment 3 Alessandro Lazarotti 2012-04-23 21:59:46 UTC
Created attachment 579704 [details]
pojo model

Comment 4 Alessandro Lazarotti 2012-04-23 22:01:26 UTC
Created attachment 579705 [details]
test scenario printscreen

Comment 7 Alessandro Lazarotti 2012-04-24 15:39:41 UTC
Created attachment 579896 [details]
pkg generated by guvnor

Comment 8 Edson Tirelli 2012-04-24 18:36:30 UTC
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 14:07:23 UTC
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 21:38:18 UTC
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3145 to Resolved

Comment 11 JBoss JIRA Server 2012-04-25 21:38:33 UTC
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3145 to Closed

Comment 12 manstis 2012-04-26 13:52:09 UTC
Guvnor fixes made to branches 5.2.x, 5.3.x, 5.4.x and master.

Comment 13 Lukáš Petrovický 2012-05-02 21:43:00 UTC
Alessandro, could you please explain what is the difference between this one and bug 814409?

Comment 14 Alessandro Lazarotti 2012-05-03 04:34:59 UTC
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 04:38:32 UTC
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

Comment 19 Red Hat Bugzilla 2025-02-10 03:19:34 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


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