Bug 1065314 - Unable to retrieve a JSON formatted Task instance via the REST API
Summary: Unable to retrieve a JSON formatted Task instance via the REST API
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER3
: 6.0.2
Assignee: Marco Rietveld
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-14 10:46 UTC by Marco Rietveld
Modified: 2018-12-05 17:17 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 19:50:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
JSON_stack_trace (9.44 KB, text/x-log)
2014-03-09 16:37 UTC, Marek Baluch
no flags Details
Received message with exception on IBM JDK (6.84 KB, text/plain)
2014-05-14 09:02 UTC, Ivo Bek
no flags Details

Description Marco Rietveld 2014-02-14 10:46:58 UTC
Description of problem:

REST operations that retrieve Task instances will fail when forced to use the JSON format (ACCEPT header). 

How reproducible:

Always.

Steps to Reproduce:
1. Call http://server:<port>/business-central/rest/task/<taskId> (GET, with ACCEPT header that specifies the application/json format)

Actual results:

An error will be thrown on the server side when the server instance tries to convert the (Jaxb)Task instance to JSON. 

Expected results:

No error will occur and the client will receive a correctly filled-in and correctly (JSON) formatted instance of the (Jaxb)Task.

Comment 1 Marco Rietveld 2014-02-14 10:48:04 UTC
JSON has been chosen as the default format to be used with business-central.

Comment 2 Marco Rietveld 2014-02-14 10:48:50 UTC
The fix for this issue is available, I am simply waiting for the appropriate flags in order to push it to the 6.0.x branch.

Comment 4 Marek Baluch 2014-03-09 16:37:16 UTC
Created attachment 872427 [details]
JSON_stack_trace

Marco,

there's still an exception present in the server log. There's a getter conflict between org.jbpm.services.task.impl.model.xml.JaxbTask#getArchived(0 params) and org.jbpm.services.task.impl.model.xml.JaxbTask#isArchived(0 params).

Please see JSON_stack_trace.log for the whole stack-trace.

Comment 5 Marek Baluch 2014-03-09 16:38:29 UTC
If I missed something then please put the issue back to ON_QA. Thanks!

Comment 7 Michael 2014-03-14 17:40:13 UTC
Ticket cherry-picked into 6.0.1.CR1. 
Commits: c66f85ebd2e63bea310fad67d4b3418a22b3ece8
         68e2cd4526495a4431b4b66fb48f5d6bde6a5006
         995a9d1bbaef260da385420a65a55383680c2443

Comment 13 Marco Rietveld 2014-03-25 18:00:23 UTC
Okay, with these commits I ended up just deleting the "isArchived()" method so that the above message isn't possible. I ran the GetTaskJSONTest and it passed. 

However, given that this is try #3, and I've already been wrong twice, I'm not saying anything else. :) 

Commits: 

6.0.x: 
https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/a8e5385a
https://github.com/droolsjbpm/jbpm/commit/aa5b4112
https://github.com/droolsjbpm/jbpm/commit/73729bf1

master: 
https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/b4fe4c67
https://github.com/droolsjbpm/jbpm/commit/cfe190e8

Comment 15 Ivo Bek 2014-04-29 12:11:07 UTC
Verified in BPMS 6.0.2.ER2

Comment 16 Ivo Bek 2014-05-14 09:01:01 UTC
Hi Marco,

the fix works well on Oracle JDK and OpenJDK but I see some problems on IBM JDK.

I rather open this issue once more than to file another one for the same problem but on IBM JDK. I get the following exception on IBM JDK 1.6 and 1.7 for the same reproducer [comment 10 https://bugzilla.redhat.com/show_bug.cgi?id=1065314#c10] :

org.codehaus.jackson.map.JsonMappingException: Conflicting getter definitions for property "archived": org.jbpm.services.task.impl.model.TaskImpl#getArchived(0 params) vs org.jbpm.services.task.impl.model.TaskImpl#isArchived(0 params) (through reference chain: org.jbpm.services.task.impl.model.xml.JaxbTask["task"])
 at org.codehaus.jackson.map.ser.StdSerializerProvider._createAndCacheUntypedSerializer(StdSerializerProvider.java:740)
 at org.codehaus.jackson.map.ser.StdSerializerProvider.findValueSerializer(StdSerializerProvider.java:344)
 at org.codehaus.jackson.map.ser.impl.PropertySerializerMap.findAndAddSerializer(PropertySerializerMap.java:39)

I am going to attach the full message I received with the stacktrace.

Thanks

Comment 17 Ivo Bek 2014-05-14 09:02:10 UTC
Created attachment 895412 [details]
Received message with exception on IBM JDK

Comment 18 Marco Rietveld 2014-05-14 11:30:19 UTC
Thanks for the thorough testing! 

Fixed. I haven't run integration tests on this, but I've fixed the cause of the problem: there were 2 "getter" methods: getArchived() and isArchived(). I've removed the getArchived() method everywhere. 

Commits: 

6.0.x: 
https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/ff773e69
https://github.com/droolsjbpm/jbpm/commit/f398cf50

master: 
https://github.com/droolsjbpm/droolsjbpm-knowledge/commit/4f486448
https://github.com/droolsjbpm/jbpm/commit/d833cd2e

Comment 19 Marek Baluch 2014-06-06 14:48:59 UTC
Test passed. Setting to VERIFIED (on BPMS 6.0.2.ER3).


Note You need to log in before you can comment on or make changes to this bug.