Bug 1008640

Summary: HttpMixin throws IllegalArgumentException if used with rest service returning void
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Jiri Sedlacek <jsedlace>
Component: SwitchYardAssignee: tcunning
Status: CLOSED WORKSFORME QA Contact: Jiri Sedlacek <jsedlace>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0 GACC: atangrin, dlesage, jsedlace, oskutka, soa-p-jira, tcunning
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
HttpMixin will throw an IllegalArgumentException if used with a rest service that returns void. This is because the httpResponse.getEntity() is null, which causes a problem in the EntityUtils.toString() method.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-22 13:42:20 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:

Description Jiri Sedlacek 2013-09-16 18:00:08 UTC
I have a service, binding is over resteasy, one method has return type void. If the method is called with HttpMixin, exception is thrown:

java.lang.IllegalArgumentException: HTTP entity may not be null
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:198)
	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:264)
	at org.switchyard.component.test.mixins.http.HTTPMixIn.sendString(HTTPMixIn.java:140)
.
.
.


http method DELETE is used, it seems that httpResponse.getEntity() is null, which cause problem in EntityUtils.toString() method.

Comment 1 Keith Babo 2013-11-05 13:58:00 UTC
Can you attach an app to reproduce this behavior?

Comment 2 tcunning 2014-10-22 13:42:20 UTC
Attempted to reproduce on 2.0.0.Alpha3 using the rest-binding quickstart and adding a void method service to the TestResource.     I did not see an exception.    Talked to Jiri and he was not able to reproduce this issue either.    Closing as cannot reproduce.