Red Hat Bugzilla – Bug 1026384
An own type of object is not unmarshalled for the process instance
Last modified: 2016-09-20 01:05:11 EDT
Created attachment 819184 [details]
Description of problem:
I have a simple process with a script task and two variables, an object, and a type. The type is set in the script task and it's a type of the given object. When I send StartProcessCommand with my own type MyType, the type in the process instance is recognized as a org.apache.xerces.dom.ElementNSImpl. I have MyType class within the kjar in the same package but it seems it doesn't even try to unmarshall the object.
Steps to Reproduce:
1. Deploy the attached kjar and create the following deployment unit:
2. Send the StartProcessCommand with myobject parameter via REST API:
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("myobject", new MyType("Hello World!"));
rc.executeCommand(DEPLOYMENT_ID, new StartProcessCommand(OBJECT_VARIABLE_PROCESS_ID, parameters), MyType.class);
Beware of BZ 1026355, you need to convert the JAXBObject on your own to add the MyType class to the JAXBContext.
3. See the server log where is printed:
type = org.apache.xerces.dom.ElementNSImpl
It's also possible to use JMS API to reproduce the error. Don't use the JBPM Remote API there is no way how to set the MyType class to the JAXBContext. I'll file another BZ for that.
I used this test to verify that the issue is fixed:
(Run mvn clean test -Dtest=JbossEapBasicAuthRestIntegrationTest in the kie-wb-tests-eap module).
Additional problems related to this issue (serialization of classes when communicating via the REST or JMS API) have been fixed in
I had made a mistake in the tests mentioned above.
This issue should be fixed in ER6. However, if it isn't, please let me know!
Verified in BPMS 6.0.0.ER7
The configuration for own remote client is quite complicated and it should be well documented!