Bug 983495 - NPE is thrown when JaxbCommandsRequest doesn't contain deploymentId
Summary: NPE is thrown when JaxbCommandsRequest doesn't contain deploymentId
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER2
: 6.0.0
Assignee: Marco Rietveld
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-11 10:24 UTC by Ivo Bek
Modified: 2016-09-20 05:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:13:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Reproducer test (2.85 KB, text/x-java)
2013-07-22 07:57 UTC, Ivo Bek
no flags Details

Description Ivo Bek 2013-07-11 10:24:30 UTC
Description of problem:

From source codes, the JaxbCommandsRequest (https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/kie-remote/kie-services-client/src/main/java/org/kie/services/client/serialization/jaxb/JaxbCommandsRequest.java) doesn't require the deploymentId to be set. For task commands the deploymentId isn't important, so it makes sense. But when I don't set it, in the server log appears following exception:

java.lang.NullPointerException
	at org.kie.services.remote.util.CommandsRequestUtil.processJaxbCommandsRequest(CommandsRequestUtil.java:24)
	at org.kie.services.remote.rest.TaskResource.execute(TaskResource.java:77)
	at org.kie.services.remote.rest.TaskResource$Proxy$_$$_WeldClientProxy.execute(TaskResource$Proxy$_$$_WeldClientProxy.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)
..........

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-07-12 11:27:15 UTC
Hi Ivo, 

Could you include more information about how you caused the NPE? It happens in a weird place and I'm not totally sure how it happened. 

Thanks!

Comment 2 Ivo Bek 2013-07-15 07:24:32 UTC
Below is the code I use to send a task command without deploymentId.

================================================
URL address = new URL(url + "/task/execute");
ClientRequest restRequest = createRequest(address);
        
JaxbCommandsRequest commandMessage = new JaxbCommandsRequest(commands); // here I don't put the deploymentId

String body = JaxbSerializationProvider.convertJaxbObjectToString(commandMessage);
restRequest.body(MediaType.APPLICATION_XML, body);

ClientResponse<JaxbCommandsResponse> responseObj = restRequest.post(JaxbCommandsResponse.class);
================================================

The exception is only in the response message and it's an internal server error (500). There is nothing more in the server log.

Comment 3 Ivo Bek 2013-07-22 07:57:27 UTC
Created attachment 776788 [details]
Reproducer test

Added a reproducer test. The test requires some changes to make it work but the main idea should be clear.

Comment 4 Ivo Bek 2013-07-22 07:59:08 UTC
I forgot one important change to reproduce the issue, following line

JaxbCommandsRequest commandMessage = new JaxbCommandsRequest(deploymentId, commands);

should be changed to

JaxbCommandsRequest commandMessage = new JaxbCommandsRequest(commands);

Comment 5 Marco Rietveld 2013-07-23 01:08:01 UTC
The commit with the fix can be found here: 

https://github.com/droolsjbpm/droolsjbpm-integration/commit/7fc8cc01d4d556cb93b3b8a8b8f126b2b680c60b

Comment 6 Ivo Bek 2013-09-09 11:41:44 UTC
Verified in BPMS 6.0.0.ER2


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