Bug 999073

Summary: A RemoteJmsRuntimeEngineFactory (JMS type) created with a non existent deployment throws NPE.
Product: [Retired] JBoss BPMS Platform 6 Reporter: Marek Baluch <mbaluch>
Component: jBPM CoreAssignee: Marco Rietveld <mrietvel>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: smcgowan
Target Milestone: ER4   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:12:03 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:

Description Marek Baluch 2013-08-20 17:23:59 UTC
Description of problem:
The following code will throw the stack trace in 'Stack-Trace:' section. Initialization of the RemoteRuntimeEngineFactory was made to create a JMS client.

RemoteRuntimeEngineFactory factory = new RemoteJmsRuntimeEngineFactory(/* ... */);
RuntimeEngine runtimeEngine = factory.newRuntimeEngine();
KieSession kieSession = runtimeEngine.getKieSession();
kieSession.startProcess("processId", null);


Stack-Trace:
java.lang.NullPointerException
	at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeJmsCommand(AbstractRemoteCommandObject.java:155)
	at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:80)
	at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:229)
	at org.perfcake.message.sender.jbpm.KieSessionBasedSender.doSend(KieSessionBasedSender.java:44)
	at org.perfcake.message.sender.AbstractSender.send(AbstractSender.java:102)
	at org.perfcake.message.generator.SenderTask.run(SenderTask.java:125)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)

Comment 1 Marco Rietveld 2013-09-04 10:40:07 UTC
This was fixed along the way by a number of small commits. 

This method here: 

https://github.com/droolsjbpm/droolsjbpm-integration/blob/6.0.x/kie-remote/kie-services-remote/src/main/java/org/kie/services/remote/jms/RequestMessageBean.java#L253

now makes sure that the NPE doesn't happen.

Comment 5 Ivo Bek 2013-10-16 12:13:54 UTC
Verified in BPMS 6.0.0.ER4