Bug 5407 - JobThreadRootControllerImpl throws NPE on transitioner when partitioned batchlet stopped
JobThreadRootControllerImpl throws NPE on transitioner when partitioned batch...
Status: NEW
Product: jbatch
Classification: Unclassified
Component: RI
1
Macintosh All
: P5 normal
: ---
Assigned To: ScottKurz
RI_only
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-22 13:16 UTC by thomas_haines
Modified: 2014-03-18 21:31 UTC (History)
1 user (show)

See Also:


Attachments
Small maven test to reproduce bug (4.77 KB, application/octet-stream)
2013-09-22 13:16 UTC, thomas_haines
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thomas_haines 2013-09-22 13:16:49 UTC
Created attachment 93 [details]
Small maven test to reproduce bug

When stopping a partitioned batchlet, JobThreadRootControllerImpl throws a NullPointerException at line 288:

IController stoppableElementController = transitioner.getCurrentStoppableElementController();

It can be reproduced with the attached simple job using the RI (SE).

Usage/stack trace below:

$ mvn test

Running org.sample.PartitionTest
21:15:30.597 [main] WARN  org.sample.PartitionTest 29 - java.lang.NullPointerException
java.lang.IllegalStateException: java.lang.NullPointerException
	at com.ibm.jbatch.container.impl.PartitionedStepControllerImpl.stop(PartitionedStepControllerImpl.java:112) ~[com.ibm.jbatch-runtime-all-1.0.jar:na]
	at com.ibm.jbatch.container.impl.JobThreadRootControllerImpl.stop(JobThreadRootControllerImpl.java:289) ~[com.ibm.jbatch-runtime-all-1.0.jar:na]
	at com.ibm.jbatch.container.impl.BatchKernelImpl.stopJob(BatchKernelImpl.java:152) ~[com.ibm.jbatch-runtime-all-1.0.jar:na]
	at com.ibm.jbatch.container.api.impl.JobOperatorImpl.stop(JobOperatorImpl.java:441) ~[com.ibm.jbatch-runtime-all-1.0.jar:na]
	at org.sample.PartitionTest.testStopPartition(PartitionTest.java:23) ~[test-classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_25]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_25]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25]
	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) ~[junit-4.11.jar:na]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.11.jar:na]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) ~[junit-4.11.jar:na]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) ~[junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) ~[junit-4.11.jar:na]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) ~[junit-4.11.jar:na]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) ~[junit-4.11.jar:na]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) ~[junit-4.11.jar:na]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) ~[junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) ~[junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) ~[junit-4.11.jar:na]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) ~[junit-4.11.jar:na]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309) ~[junit-4.11.jar:na]
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53) ~[na:na]
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123) ~[na:na]
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104) ~[na:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_25]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_25]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25]
	at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25]
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164) ~[surefire-api-2.10.jar:2.10]
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110) ~[surefire-booter-2.10.jar:2.10]
	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175) ~[surefire-booter-2.10.jar:2.10]
	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107) ~[surefire-booter-2.10.jar:2.10]
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68) ~[surefire-booter-2.10.jar:2.10]
Caused by: java.lang.NullPointerException: null
	at com.ibm.jbatch.container.impl.JobThreadRootControllerImpl.stop(JobThreadRootControllerImpl.java:287) ~[com.ibm.jbatch-runtime-all-1.0.jar:na]
	at com.ibm.jbatch.container.impl.BatchKernelImpl.stopJob(BatchKernelImpl.java:152) ~[com.ibm.jbatch-runtime-all-1.0.jar:na]
	at com.ibm.jbatch.container.impl.PartitionedStepControllerImpl.stop(PartitionedStepControllerImpl.java:108) ~[com.ibm.jbatch-runtime-all-1.0.jar:na]
	... 33 common frames omitted
Comment 1 ScottKurz 2014-03-18 21:31:33 UTC
Pushed fix into Git (6a1fe05f838e61a47e96b2a073d3a20417d91de5).  Not sure when we'll push to Maven quite yet.