Description of problem: When a StatefulKnowledgeSession.dispose() is called on already disposed session NullPointerException is thrown. Version-Release number of selected component (if applicable): BRMS-5.2.0-ER3 How reproducible: every time Steps to Reproduce: 1. create new stateful session 2. dispose it 3. dispose it again Actual results: java.lang.NullPointerException at org.jbpm.process.instance.ProcessRuntimeImpl.dispose(ProcessRuntimeImpl.java:371) at org.drools.common.AbstractWorkingMemory.dispose(AbstractWorkingMemory.java:1251) at org.drools.reteoo.ReteooStatefulSession.dispose(ReteooStatefulSession.java:179) at org.drools.impl.StatefulKnowledgeSessionImpl.dispose(StatefulKnowledgeSessionImpl.java:251) at org.jboss.qa.drools.disposeNPE.DisposeNPETest$Test.run(DisposeNPETest.java:51) at org.jboss.qa.drools.disposeNPE.DisposeNPETest.main(DisposeNPETest.java:35) Expected results: Additional info: This is caused by users using dispose() as a way to clean the state of the session. I suppose that when session is disposed it should be unusable but in case of using it an understandable exception should be thrown (like AlreadyDisposedException). And the documentation should clearly state that disposed sessions are not to be used.
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-1880 to Resolved
Edson Tirelli <ed.tirelli> made a comment on jira JBRULES-1880 Fixed. Calling any session's method after disposing the session will now raise an IllegalStateException.
Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-1880 to Closed
It is fixed now. Thank you
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: A Null Pointer Exception was thrown when calling StatefulKnowledgeSession.dispose() on already disposed session. The issue has been resolved, calling any session's method after disposing the session now raises an IllegalStateException.
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.