Bug 1010259

Summary: NPE when there is no running process for GetProcessInstanceCommand via JMS
Product: [Retired] JBoss BPMS Platform 6 Reporter: Ivo Bek <ibek>
Component: Business CentralAssignee: Marco Rietveld <mrietvel>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: ibek, kverlaen, rzhang, smcgowan
Target Milestone: ER5   
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:10:36 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:
Attachments:
Description Flags
server log containing repeating NPE none

Description Ivo Bek 2013-09-20 11:58:02 UTC
Created attachment 800469 [details]
server log containing repeating NPE

Description of problem:

I send GetProcessInstanceCommand via JMS for already completed process. It should throw BadRequestException with explanation that the process instance may have been completed but instead of that I receive following response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><command-response><deployment-id>org.jboss:integration:1.0.0.Final</deployment-id><exception><command-name>GetProcessInstanceCommand</command-name><message>NullPointerException thrown with message 'null'</message></exception></command-response>

In the attached part of server log is repeating NPE when it couldn't commit a session. It seems the GetProcessInstanceCommand couldn't be executed because of that.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Marco Rietveld 2013-10-04 20:22:17 UTC
The GetProcessInstanceCommand usually just returns null if the process instance has completed or does not exist. 

Would it be okay to have the JMS api do this as well?  In this case, the JaxbCommandsResponse object would then contain no response matching the sent GetProcessInstanceCommand. 

Otherwise, I'm a little nervous about the precedent I'm setting: I'd rather the JMS api just be a remote API than develop into an API that acts differently than the "local" (normal) API. 

What do you think? 

This behaviour is available, at latest, starting with these commits: 

6.0.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/ca439c9dd697bcd2418efaf32d3ed597f8246395

master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/8b7c8003959e7c35bde2e418bee2de5e07eacb41

Comment 2 Ivo Bek 2013-10-07 08:26:08 UTC
The returned null is surely good but the thrown exception gives much more information what happened as it's done in REST API. There is thrown BadRequestException with statement containing "requested process instance may have been completed".

I don't know where is the border between REST API and JMS API but if you see it complicated, it can be done without the exception. Also I'd say the remote API already acts differently than the local API.

Comment 3 Marco Rietveld 2013-10-08 11:20:09 UTC
Ivo, thanks for your feedback. 

I agree that it would be better: unfortunately, it's slightly complicated to add it. 

The larger issue for me is that the cost to maintain this feature is much higher than it's added value. In other words, I think that when other developers look at the code to do this, that they might end up further expanding it, which would (IMHO) be very bad for the remote api. 

Setting to modified and keeping the "returns null" solution.

Comment 5 Ivo Bek 2013-12-05 10:26:17 UTC
Verified in BPMS 6.0.0.ER5