Bug 1215572 - (6.0.x) Injected Context becomes invalid after Service Reference is invoked
Summary: (6.0.x) Injected Context becomes invalid after Service Reference is invoked
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0 GA
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: CR1
: ---
Assignee: tcunning
QA Contact: Matej Melko
URL:
Whiteboard:
Depends On: 1215570
Blocks: 1214695
TreeView+ depends on / blocked
 
Reported: 2015-04-27 07:25 UTC by Tadayoshi Sato
Modified: 2025-02-10 03:47 UTC (History)
4 users (show)

Fixed In Version:
Clone Of: 1215570
Environment:
Last Closed: 2025-02-10 03:47:33 UTC
Type: Support Patch
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SWITCHYARD-2674 0 Major Resolved Context/Message/Exchange injection is corrupted after another bean invocation 2016-11-02 13:07:40 UTC

Description Tadayoshi Sato 2015-04-27 07:25:40 UTC
+++ 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

Comment 2 tcunning 2015-10-13 02:34:51 UTC
Backported to 1.x branch of components.

Comment 4 ppecka 2016-03-09 22:31:59 UTC
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.

Comment 5 Red Hat Bugzilla 2025-02-10 03:47:33 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


Note You need to log in before you can comment on or make changes to this bug.