Bug 1010259 - NPE when there is no running process for GetProcessInstanceCommand via JMS
Summary: NPE when there is no running process for GetProcessInstanceCommand via JMS
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER5
: 6.0.0
Assignee: Marco Rietveld
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-20 11:58 UTC by Ivo Bek
Modified: 2016-09-20 05:04 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:10:36 UTC
Type: Bug
Embargoed:


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

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


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