Bug 1010259 - NPE when there is no running process for GetProcessInstanceCommand via JMS
NPE when there is no running process for GetProcessInstanceCommand via JMS
Status: CLOSED CURRENTRELEASE
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.0.0
Unspecified Unspecified
high Severity high
: ER5
: 6.0.0
Assigned To: Marco Rietveld
Ivo Bek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-20 07:58 EDT by Ivo Bek
Modified: 2016-09-20 01:04 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 16:10:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
server log containing repeating NPE (87.78 KB, text/x-log)
2013-09-20 07:58 EDT, Ivo Bek
no flags Details

  None (edit)
Description Ivo Bek 2013-09-20 07:58:02 EDT
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 16:22:17 EDT
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 04:26:08 EDT
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 07:20:09 EDT
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 05:26:17 EST
Verified in BPMS 6.0.0.ER5

Note You need to log in before you can comment on or make changes to this bug.