Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1087941

Summary: JSON entities are not un/wrapped in the REST API
Product: [Retired] JBoss BRMS Platform 6 Reporter: Ivo Bek <ibek>
Component: Business CentralAssignee: Marco Rietveld <mrietvel>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.2CC: etirelli, kverlaen, lpetrovi, mrietvel, rrajasek, rzhang, smcgowan
Target Milestone: ER3   
Target Release: 6.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:54:33 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 Ivo Bek 2014-04-15 16:13:16 UTC
Description of problem:

As I talked with Marco Rietveld, there was a change which requires configuration of Jackson to wrap and unwrap messages.

this.configure(org.codehaus.jackson.map.DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
this.configure(org.codehaus.jackson.map.SerializationConfig.Feature.WRAP_ROOT_VALUE, true);

When I changed the code to do that, BPMS 6.0.2.ER1 Remote API has started working but on the other hand BRMS 6.0.2.ER1 has stopped working. It means that when I send a request there, it is not recognized and this exception is risen:

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "RepositoryRequest" (Class org.kie.workbench.common.services.shared.rest.RepositoryRequest), not marked as ignorable
 at [Source: org.apache.catalina.connector.CoyoteInputStream@1df057f; line: 1, column: 23] (through reference chain: org.kie.workbench.common.services.shared.rest.RepositoryRequest["RepositoryRequest"])
	at org.codehaus.jackson.map.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:53) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.deser.StdDeserializationContext.unknownFieldException(StdDeserializationContext.java:267) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.deser.std.StdDeserializer.reportUnknownProperty(StdDeserializer.java:673) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:659) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.deser.BeanDeserializer.handleUnknownProperty(BeanDeserializer.java:1365) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.deser.BeanDeserializer._handleUnknown(BeanDeserializer.java:725) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:703) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2704) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315) [jackson-mapper-asl-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419) [jackson-jaxrs-1.9.9-redhat-2.jar:1.9.9-redhat-2]
	at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:105) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.read(GZIPDecodingInterceptor.java:63) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:108) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
	at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:169) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
	... 38 more

I believe the changes from BZ 1050894 only changed behaviour of BPMS Remote API and so the behaviour of BRMS Remote API stayed unchanged. I suggest to put the configuration to a shared code base.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Marco Rietveld 2014-04-16 18:33:52 UTC
Fixed. Commits: 

6.0.x:
https://github.com/droolsjbpm/drools-wb/commit/21e36abd

master:
https://github.com/droolsjbpm/drools-wb/commit/7315a725


*PLEASE NOTE*:

The jackson-mapper-asl and jackson-xc dependencies should be added to the BRMS artifacts if they are not already present there!

Comment 2 Marco Rietveld 2014-04-16 18:40:06 UTC
Re: jackson-mapper-asl and jackson-xc dependencies. 

I'm now noticing that those jars are installed with AS7/EAP6 as part of the modules. 

However, in my arquillian tests using AS7, deploying the (drools-wb) war to test this issue would fail because ClassNotFoundExceptions thrown for classes that are in those 2 jars. 

Uhm..?? I guess they don't need to be added then?

Comment 3 Lukáš Petrovický 2014-04-28 15:22:17 UTC
Ivo, you're the reporter here, please verify.

Comment 4 Ivo Bek 2014-04-29 12:40:45 UTC
Verified in BRMS 6.0.2.ER2. This works because the smoke tests passed.

Comment 5 Marco Rietveld 2014-05-01 06:51:48 UTC
We've decided to revert the commits that fixed this issue and BZ 1050894. 

Since it's been done for both BPMS and BRMS, this issue should still be solved. 

However, the code has changed, which is why I'm reopening this issue.

Comment 6 Marco Rietveld 2014-05-05 13:29:34 UTC
Since the commits that changed this on *both* BPMS and BRMS have been reverted, this problem should still be fixed. 

Setting to MODIFIED so that QA can verify.

Comment 7 Ivo Bek 2014-05-30 13:48:34 UTC
Verified in BPMS 6.0.2.ER3