+++ This bug was initially created as a clone of Bug #1215570 +++ 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
Backported to 1.x branch of components.
VERIFIED the above mentioned exception does not appear with suggested reproducer java.lang.IllegalStateException: SWITCHYARD030422: Illegal call to get the SwitchYard Context; must be called within the execution of an ExchangeHandler chain.