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

Bug 1092644

Summary: Business-central deployed on WebSphere fails to clone repository via REST, unable to parse request.
Product: [Retired] JBoss BRMS Platform 6 Reporter: Radovan Synek <rsynek>
Component: Business CentralAssignee: Maciej Swiderski <mswiders>
Status: CLOSED CURRENTRELEASE QA Contact: Radovan Synek <rsynek>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.0.2CC: ibek, kverlaen, mrietvel, rrajasek
Target Milestone: ER3Keywords: TestBlocker
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:53:14 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:
Attachments:
Description Flags
REST response
none
response from EAP
none
patched drools-wb-rest jar
none
patched kie-services-jaxb jar
none
patched kie-services-client jar none

Description Radovan Synek 2014-04-29 16:12:44 UTC
Created attachment 890856 [details]
REST response

Cloning repository via REST failed, as server side wasn't able to parse the request:

POST  http://${host}:${port}/business-central/rest/repositories

{"RepositoryRequest":["org.kie.workbench.common.services.shared.rest.RepositoryRequest",{"name":"bpms-assets","description":null,"userName":null,"password":null,"requestType":"clone","gitURL":"git://git.app.eng.bos.redhat.com/bpms-assets.git"}]}

returning "UnrecognizedPropertyException thrown with message 'Unrecognized field "RepositoryRequest" (Class org.kie.workbench.common.services.shared.rest.RepositoryRequest)". Please see the attached full response.

Comment 1 Maciej Swiderski 2014-04-30 09:40:26 UTC
Radek, I just tried it on WAS and all works well for both create new repository and clone repository. Important to note is that the header Content-Type is set to application/json and that the request body is proper JSON string that is accepted by the system which is for example:
{
  "name":"new-project-repo",
  "description":"repo for my new project",
  "userName":null,"password":null,
  "requestType":"new",
  "gitURL":null
}
that string will be used to construct RepositoryRequest instance on runtime. Don't see a need to specify RepositoryRequest class name etc as part of the JSON string.

Comment 2 Radovan Synek 2014-04-30 11:52:29 UTC
Maciejs, the JSON request you provided works with WebSphere, but cause an exception when used with EAP:
JsonMappingException thrown with message 'Root name 'name' does not match expected ('RepositoryRequest') for type [simple type, class org.kie.workbench.common.services.shared.rest.RepositoryRequest]

complete response is attached.

Comment 3 Radovan Synek 2014-04-30 11:54:45 UTC
Created attachment 891167 [details]
response from EAP

Comment 4 Ivo Bek 2014-04-30 12:02:50 UTC
Maciej, here is the BZ 1050894 for which the format has changed. Also the behaviour was different between BPMS and BRMS ( see BZ 1087941). So I believe it should be fixed here as well.

Comment 5 Kris Verlaenen 2014-04-30 22:29:32 UTC
Created attachment 891325 [details]
patched drools-wb-rest jar

Comment 6 Kris Verlaenen 2014-04-30 22:30:11 UTC
Created attachment 891326 [details]
patched kie-services-jaxb jar

Comment 7 Kris Verlaenen 2014-04-30 22:31:58 UTC
Attached are two patched jars.  After dropping these as a replacement in the business-central eap war (in business-central.war/WEB-INF/lib replacing the old ones), the REST request as specified in Comment 1 now completed successfully on EAP as well.

Comment 9 Marco Rietveld 2014-05-02 07:07:40 UTC
Created attachment 891728 [details]
patched kie-services-client jar

Comment 10 Radovan Synek 2014-06-02 07:56:47 UTC
Verified with BPMS-6.0.2.ER3