Created attachment 1019253 [details] reproducer Description of problem: Platform BZ for https://issues.jboss.org/browse/SWITCHYARD-2674 In a Bean service ('OuterService' below), after invoking a Bean service reference ('InnerService' below) the injected Context becomes invalid, throwing the following exception: > java.lang.IllegalStateException: SWITCHYARD030422: Illegal call to get the SwitchYard Context; must be called within the execution of an ExchangeHandler chain. @Service(value = OuterService.class) public class OuterServiceBean implements OuterService { @Inject private Context context; @Inject @Reference private InnerService inner; @Override public int getNumber(String in) { // This succeeds context.setProperty("FIRST", 1, Scope.EXCHANGE); // Invoke the referenced service int val = inner.parseNumber(in); // This fails since it is after the reference invocation context.setProperty("SECOND", 2, Scope.EXCHANGE); return val; } } Version-Release number of selected component (if applicable): n/a How reproducible: 100% Steps to Reproduce: 1. Run `mvn test` against the attached reproducer. Actual results: Test doesn't pass. Expected results: Test should pass. Additional info: n/a
Created attachment 1055475 [details] Reproducer for second use case. The second reproducer demonstrates Exchange corruption after a Bean Component invokes a Reference, then another Reference is invoked after that. (It doesn't seem to matter if the two downstream components are invoked 'in parallel' or 'in series', there is a failure.) To see the problem, install the application then use curl to post a request: curl -v -H "Content-Type: text/plain" -X POST --data "@someData.txt" http://localhost:8080/example/acceptXML # someData.txt <xml>some data</xml>