Red Hat Bugzilla – Bug 1010259
NPE when there is no running process for GetProcessInstanceCommand via JMS
Last modified: 2016-09-20 01:04:57 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):
Steps to Reproduce:
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:
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.
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.
Verified in BPMS 6.0.0.ER5