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

Bug 1071846

Summary: Although JSON response type is declared, drools-wb-rest returns XML in case of any error.
Product: [Retired] JBoss BRMS Platform 6 Reporter: Radovan Synek <rsynek>
Component: Business CentralAssignee: Marco Rietveld <mrietvel>
Status: CLOSED WORKSFORME QA Contact: Radovan Synek <rsynek>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.1CC: etirelli, kverlaen, mrietvel, rrajasek, smcgowan, wsiqueir
Target Milestone: ER1   
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: 2015-12-07 14:59:24 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
response XML
none
error response screenshot
none
screenshot with error response - 6.2.0.SNAPSHOT none

Description Radovan Synek 2014-03-03 10:02:05 UTC
Take a look at drool-wb-rest, namely ProjectResource. Each operation declares JSON response type, but when exception occurs, error response is serialized to XML. The response type should be consistent regardless the operation was successful or not, so that client code can parse the response.

Steps to Reproduce:
1. start a business-central
2. POST http://localhost:8080/business-central/rest/repositories with content-type application/json and request body:
{"name":"jbpm-playground","requestType":"new"}
3. repeat point number 2, RepositoryAlreadyExistsException should be returned, but in XML format.

Comment 1 Radovan Synek 2014-03-03 10:12:13 UTC
Created attachment 869873 [details]
response XML

Comment 3 Radovan Synek 2014-04-23 08:01:31 UTC
Created attachment 888798 [details]
error response screenshot

Comment 4 Radovan Synek 2014-04-23 08:04:50 UTC
The issue persists in BPMS-6.0.2.ER1. Please take a look at the newly attached screenshot.

Comment 5 Marco Rietveld 2014-08-11 11:47:02 UTC
There has been significant refactoring work on the REST services in for BxMS 6.1/commuinty 6.2. I think that this problem may have been fixed as a result and I've asked Radovan to retest it.

Comment 6 Radovan Synek 2014-08-11 15:16:12 UTC
(In reply to Marco Rietveld from comment #5)
> There has been significant refactoring work on the REST services in for BxMS
> 6.1/commuinty 6.2. I think that this problem may have been fixed as a result
> and I've asked Radovan to retest it.

Marco, I've retested with the most recent snapshot: kie-wb-distribution-wars-6.2.0-20140810.162733-61-eap-6_1.war. I've added a single user and started EAP 6.1.1 with standalone-full profile. Problem is still there, see the attached screenshot. An attempt to start a non-existing task ended up with an exception (NPE) serialized to XML. Similarly, attempt to send request to create a new repository with messed up request body resulted in XML exception response.

Comment 7 Radovan Synek 2014-08-11 15:17:30 UTC
Created attachment 925815 [details]
screenshot with error response - 6.2.0.SNAPSHOT

Comment 8 Marco Rietveld 2014-08-11 15:37:47 UTC
Radovan, the behaviour for the task operation was correct: that response should be in XML, seeing as the default for the task, runtime and deployment operations is XML. 

AFAIK, this BZ only targets the XML-formatted exceptions created when doing knowledge store REST operations, such as improperly creating a new repoository. You've tested that again as well and shown that it still doesn't work, so I'll take another look at it.

Comment 9 Marco Rietveld 2015-08-25 07:51:00 UTC
*** Bug 1255566 has been marked as a duplicate of this bug. ***

Comment 11 Radovan Synek 2015-12-07 14:59:24 UTC
Unable to reproduce with 6.2.0.GA -> closing.