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:
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!
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.
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.
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);
The commit with the fix can be found here: https://github.com/droolsjbpm/droolsjbpm-integration/commit/7fc8cc01d4d556cb93b3b8a8b8f126b2b680c60b
Verified in BPMS 6.0.0.ER2