Bug 1119560
Summary: | Execution Server: RestOperationException thrown on pInstance variable of type Long | ||
---|---|---|---|
Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | jbride <jbride> |
Component: | Business Central | Assignee: | Marco Rietveld <mrietvel> |
Status: | CLOSED EOL | QA Contact: | Ivo Bek <ibek> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 6.0.2 | CC: | jbride, kverlaen, mbaluch |
Target Milestone: | ER5 | ||
Target Release: | 6.1.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-03-27 20:01:23 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
jbride@redhat.com
2014-07-15 04:26:01 UTC
Hi Jeff, Sorry to be such a stickler, but could you provide the following information? - Expected results: Thanks! A similar feature was fixed for String, however I know get a different exception for Long: Could not find MessageBodyWriter for response object of type: java.lang.Long of media type: application/xml fix provided to wrap primitives and their wrappers with custom JAXBElement - JaxbVarElement. Reason for creating custom JAXBElement was to provide consistent support for both XML and JSON representation types. So for all process variables taken from runtime (not history) all will be wrapped and will look like following: XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><value>100</value> JSON: { value: 100 } in addition a optional support for wrapping String types was provided as well to produce valid xml and json response and can be enabled with system property: org.kie.remote.wrap.string=true that way response for String variables will be as follows: XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><value>john</value> JSON: { value: "john" } by default that spring wrapper is disabled and will produce following response: XML: john JSON: john which in general is invalid format for both xml and json, though can be interpreted directly thus I left it as it for backward compatibility. in addition in case one would like to use RestEasy client API following could be used to get hold of variable values: ClientRequest restRequest = createRequest(new URL("url to rest resource")); //regular RestEasy client api request ClientResponse responseObj = restRequest.get(); JAXBElement<Long> res = (JAXBElement<Long>) responseObj.getEntity(new GenericType<JAXBElement<Long>>(){}); Long variableValue = res.getValue(); droolsjbpm-integration master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/d7337aef5402ba933c162502d7523fb547a6686c 6.2.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/25ea24f89e3827f4b782dc1ff5da2d0c6d029afa described solution does work completely, still working on this.... please ignore comment number 4 when it comes to the solution, it has been changed as it proved to be not reliable and caused other issues with jab marshaling. There are primitive wrapper jab classes provided and in case process variable is of primitive type or its wrapper then jab wrapper class for that type will be used. This has proven to work well for all types and for both XML and JSON content types. XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><long-type><value>100</value></long-type> JSON: { value: 100 } as it can be seen for XML it has a root element that defines its type : <long-type> and it will have different depending on actual value e.g. <boolean-type> etc. in addition an optional support for wrapping String types was provided as well to produce valid xml and json response and can be enabled with system property: org.kie.remote.wrap.string=true that way response for String variables will be as follows: XML: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><string-type><value>john</value></string-type> JSON: { value: "john" } by default that string wrapper is disabled and will produce following response: XML: john JSON: john which in general is invalid format for both xml and json, though can be interpreted directly thus I left it as it for backward compatibility. in addition in case one would like to use RestEasy client API following could be used to get hold of variable values: ClientRequest restRequest = createRequest(new URL("url to rest resource")); //regular RestEasy client api request ClientResponse responseObj = restRequest.get(); JaxbLong res = (JaxbLong) responseObj.getEntity(JaxbLong.class); Long variableValue = res.getValue(); droolsjbpm-integration master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/d83f4ba384aa89a2438afa81ec625b568b82a9d5 6.2.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/1b6209548f399d90e8541587c0040a6cd3c29030 Verified in BPMS 6.1.0.ER5 Trying to get the primitive type produces: org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type application/xml and type null However, when we change it to JaxbInteger it works as expected. |