Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1195130

Summary: [6.0.3.RP#3] NullPointerException at GlobalTimerService.getTimerJobInstances(GlobalTimerService.java:149)
Product: [Retired] JBoss BPMS Platform 6 Reporter: Toshiya Kobayashi <tkobayas>
Component: jBPM CoreAssignee: Alessandro Lazarotti <alazarot>
Status: CLOSED EOL QA Contact: Marek Baluch <mbaluch>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.3CC: kverlaen, rrajasek
Target Milestone: CR1   
Target Release: One-off release   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1167738 Environment:
Last Closed: 2020-03-27 20:11:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1167738    
Bug Blocks: 1188473, 1205795    
Attachments:
Description Flags
BZ1167738_null_job_603rp2.zip none

Description Toshiya Kobayashi 2015-02-23 07:57:22 UTC
+++ This bug was initially created as a clone of Bug #1167738 +++

Description of problem:

If a transaction is rolled back after a Timer execution, a 'null' jobHandle is pushed into jobHandles list (GlobalTimerService.timerJobsPerSession). So NullPointerException is raised in GlobalTimerService.getTimerJobInstances().

=====
Caused by: java.lang.NullPointerException
	at org.jbpm.process.core.timer.impl.GlobalTimerService.getTimerJobInstances(GlobalTimerService.java:149)
	at org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate.getTimerJobInstances(RegisteredTimerServiceDelegate.java:107)
	at org.drools.core.marshalling.impl.ProtobufOutputMarshaller.serializeSession(ProtobufOutputMarshaller.java:213)
	at org.drools.core.marshalling.impl.ProtobufOutputMarshaller.writeSession(ProtobufOutputMarshaller.java:119)
	at org.drools.core.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:166)
	at org.drools.core.marshalling.impl.ProtobufMarshaller.marshall(ProtobufMarshaller.java:148)
	at org.drools.persistence.SessionMarshallingHelper.getSnapshot(SessionMarshallingHelper.java:64)
	at org.drools.persistence.info.SessionInfo.update(SessionInfo.java:85)
====

Version-Release number of selected component (if applicable):
BPMS 6.0.3 roll-up patch #2

Steps to Reproduce:
1. Run attached BZ1167738_null_job_603rp2.zip

Actual results:
NullPointerException is thrown. ("java.lang.RuntimeException: roll back!" is an intentional Exception so you can ignore)

Caused by: java.lang.NullPointerException
	at org.jbpm.process.core.timer.impl.GlobalTimerService.getTimerJobInstances(GlobalTimerService.java:149)


Expected results:
The transaction rollback should be performed without any problems.

Additional info:
The unit test in BZ1167738 fix commit (ExceptionAfterTimerNodeTest.java
 in https://github.com/droolsjbpm/jbpm/commit/ccd47359f9433115dff329a19826326ee2ea8d68) doesn't reproduce the issue with 6.0.x branch because of some changes in JbpmJUnitBaseTestCase. So I wrote another reproducer for this BZ.

Comment 1 Toshiya Kobayashi 2015-02-23 07:58:18 UTC
Created attachment 994312 [details]
BZ1167738_null_job_603rp2.zip

Comment 6 Maciej Swiderski 2015-03-30 17:58:11 UTC
backported to 6.0.x

jbpm
6.0.x:
https://github.com/droolsjbpm/jbpm/commit/622aa623d87340c2fc1514728d4c54ecb20d8843

Comment 8 Jiri Svitak 2015-04-16 12:37:01 UTC
Verified in 6.0.3.RP#3.