| Summary: | JAXBException when starting a process with array in parameters via jbpm remote api | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Ivo Bek <ibek> | ||||||
| Component: | Business Central | Assignee: | Marco Rietveld <mrietvel> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Ivo Bek <ibek> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 6.0.0 | CC: | kverlaen, mbaluch, rrajasek, smcgowan | ||||||
| Target Milestone: | ER5 | ||||||||
| Target Release: | 6.0.0 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2014-08-06 20:09:48 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Attachments: |
|
||||||||
|
Description
Ivo Bek
2013-10-30 15:47:30 UTC
Created attachment 817494 [details]
stacktrace
Source-code-snipp how to reproduce:
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("url", "http://soaptest.parasoft.com/calculator.wsdl");
parameters.put("namespace", "http://www.parasoft.com/wsdl/calculator/");
parameters.put("interface", "Calculator");
parameters.put("operation", "add");
parameters.put("parameters", new Float[]{9.0f, 12.0f});
ProcessInstance pi = rc.startProcess(WEB_SERVICE_WORK_ITEM_PROCESS_ID, parameters);
System.out.println(((WorkflowProcessInstance)pi).getVariable("result"));
Thanks Ivo and Marek. I see this more as a missing feature than as a bug: the problem is that I haven't documented or otherwise specified that the Remote api only accepts serializable parameters, which primitive arrays are not. I'm fairly sure that one easy way to get around this issue is to use a List instead of a primitive array, although I haven't confirmed that. Hi Marco,
I'm sorry but I cannot agree with you that the primitive arrays are not serializable. To support my statement, try the following code:
public static void main(String[] args) {
Object o = new Float[]{9.0f, 12.0f};
System.out.println("Is a primitive array serializable? " + ((o instanceof Serializable)?"yes":"no")); // prints yes
}
I strongly believe then, this is a bug, so I wouldn't use List as the only solution.
I have a similar issue when I use StartProcessCommand:
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("url", "http://soaptest.parasoft.com/calculator.wsdl");
parameters.put("namespace", "http://www.parasoft.com/wsdl/calculator/");
parameters.put("interface", "Calculator");
parameters.put("operation", "add");
parameters.put("parameters", new Float[]{9.0f, 12.0f});
rc.executeCommand(DEPLOYMENT_ID, new StartProcessCommand(WEB_SERVICE_WORK_ITEM_PROCESS_ID, parameters));
testWebServiceWorkItem(org.jboss.qa.bpms.jbpm.integration.remote.WorkItemHandlerTest) Time elapsed: 0.437 sec <<< ERROR!
javax.xml.bind.MarshalException: null
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:588)
.......
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:116)
at org.kie.services.client.serialization.jaxb.JaxbSerializationProvider.convertJaxbObjectToString(JaxbSerializationProvider.java:38)
at org.jboss.qa.bpms.jbpm.integration.remote.RestController.executeCommand(RestController.java:342)
at org.jboss.qa.bpms.jbpm.integration.remote.RestController.executeCommand(RestController.java:333)
at org.jboss.qa.bpms.jbpm.integration.remote.WorkItemHandlerTest.testWebServiceWorkItem(WorkItemHandlerTest.java:35)
The error is gone when I add Float[].class to JAXBContext. So you can add the array types to the JaxbSerializationProvider classes or make it customizable (BZ 1026355, BZ 1026402). Fixed: 6.0.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/c2fd03a895ca1b6f16b354a51463c8ba78f9d673 master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/172991ed76f0eb434f6a6bfcebb4d18700565cd2 Verified in BPMS 6.0.0.ER5 note: the given reproducer still doesn't work due to BZ 1026384 |