Bug 1072840
| Summary: | JAXB exception due to serialization of task parameters | ||
|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Pedro Zapata <pzapataf> |
| 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: | agiertli, kverlaen, mbaluch, pzapataf, rrajasek, smcgowan, tlivora, vigoyal |
| Target Milestone: | ER3 | ||
| Target Release: | 6.0.2 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Sending an object as a parameter to the execute task for a REST service resulted in a SerializationException error. This error only occurred when calling the complete method of TaskService. If CompleteTaskCommand was used and the execute method of KieSession was invoked with this command as a parameter there was no error and the task status was changed to completed. This applied to both REST and JMS. This issue has now been fixed.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-08-06 19:51:01 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: | |
| Embargoed: | |||
|
Description
Pedro Zapata
2014-03-05 09:38:54 UTC
As a side note, please not I had to force the following dependency in the client code (pom.xml). Otherwise, there was a mix of 4.1.2 and 4.2.1 versions. Not sure if this was due to some local build problem (even I ran a full build) or a problem with that specific dependency, so it's probably a good idea to double check this. <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.2.1</version> </dependency> Hi Pedro, In order to be able to send the object back and forth, any custom objects need to be annotated correctly with JAXB annotations. At least @XmlRootElement and @XmlElement must be present. See this for an example: https://github.com/droolsjbpm/kie-tests/blob/6.0.x/remote-kie-tests/kie-wb-tests/kie-wb-tests-base/src/main/java/org/kie/tests/wb/base/test/objects/MyType.java The JAXB annotations are neccessary in order to be able to de/serialize the object when receiving or sending it to business-central/kie-wb. Pedro, Would you be able to add these annotations and retest? --- Also, thanks for pointing out the httpclient deps: I heard a similar comment from someone else recently and will make sure to double check it. --- NOTE TO MARCO: Make sure that this is clear in product and community docuemntation!! Hi Marco, I'll retest with those annotations, but I still wonder why the process launch method does work correctly without the annotations, with the same POJO parameter in. Shouldn't this be required for this call as well? Pedro, I'm pretty sure it just "looks" like the process launch method (KieSession.startProcess( String PROCESS_NAME, Map<String, Object> params)) works. What actually happens is that the object is deserialized to an instance of the org.apache.xerces.dom.ElementNSImpl class on the server side, which is not usable most of the time. Pedro, with regards to the process launch method, see BZ 1078969 Pedro, please let me know when you have had a chance to retest this issue. I have just tested it again and found out that this problem only occurs when calling complete method of TaskService. If I use CompleteTaskCommand and call execute method of KieSession with this command as a parameter there is no error and task status is changed to completed. This applies to both REST and JMS. Why is this BZ's status ON_QA? In previous comments I only mentioned that there is a workaround (executing CompleteTaskCommand). However, it is not possible to complete tasks using TaskService. SerializationException is still present as mentioned in the original Pedro's post. And no fix has been provided so far. Since version 6.0.2 ER2 executing CompleteTaskCommand does not work either. ClassCastException is thrown with message 'org.apache.xerces.dom.ElementNSImpl cannot be cast to org.jboss.qa.bpms.jbpm.integration.MyType'. Fixed. Commits: 6.0.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/8ad44c43 master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/e874a3fc ***NOTE***: if you are not using the Remote API Java client instances, but are sending JaxbCommandsRequest instances to the ../rest/task/execute URL, you must add a query parameter indicating the deployment id! Otherwise, it will be impossible to determine which deployment the serialized class is available in and to load it for deserialization on the server side. In other words, when sending JaxbCommandsRequest instances that concern task or audit commands, please use this URL: "../rest/task/execute?deploymentId=<actual-deployment-id>". Otherwise, simplying using the "../rest/runtime/<actual-deployment-id>/execute URL for all JaxbComandsRequest instances is also fine. The Remote Java API client instances now contain this logic as well. Maciej found an NPE hidden in the changes. This is a fix for that: master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/e54d0851 6.0.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/3f2c75fd Verified in BPMS 6.0.2.ER3 |