Bug 1102495

Summary: Revisit exception handling in one way invocations
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Tadayoshi Sato <tasato>
Component: SwitchYardAssignee: Rob Cernich <rcernich>
Status: MODIFIED --- QA Contact: Matej Melko <mmelko>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0 GACC: rcernich, soa-p-jira
Target Milestone: ER1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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
Reproducer none

Description Tadayoshi Sato 2014-05-29 05:15:50 UTC
Description of problem:
Platform BZ for https://issues.jboss.org/browse/SWITCHYARD-2155

REST Binding always returns 204 (No Content) for void REST methods even when SwitchYard application throws an exception. Note that a bare RESTEasy app without SY behaves differently, i.e. it returns 204 for void methods only when the REST method returns successfully and instead returns 500 when it throws an error.

I'm attaching a simple reproducer project. Say I have a following REST interface:

@Path("/")
public interface SampleResource {
    @GET
    @Path("/ok")
    void ok();

    @GET
    @Path("/error")
    void error();
}

and have the following Bean service:

@Service(SampleService.class)
public class SampleServiceBean implements SampleService {
    @Override
    public void ok() {
        System.out.println("ok");
    }
    @Override
    public void error() {
        System.out.println("error");
        throw new RuntimeException();
    }
}

Running the Client.java, you will get the following result.

http://localhost:8080/sample/ok    => 204
http://localhost:8080/sample/error => 204

However, what I expect is getting some error (such as 500) for the latter request instead of getting 204.

Comment 1 Tadayoshi Sato 2014-05-29 05:16:40 UTC
Created attachment 900224 [details]
Reproducer