[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4438) Circular Injection causes Seam Injected variables to be null before invocation is complete

Tim Evers (JIRA) jira-events at lists.jboss.org
Thu Oct 8 19:14:05 EDT 2009


Circular Injection causes Seam Injected variables to be null before invocation is complete
------------------------------------------------------------------------------------------

                 Key: JBSEAM-4438
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4438
             Project: Seam
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.1.0.GA
         Environment: I've only tested this on 2.1.0.GA so far, but I can't see anything in the release notes that would have fixed this in other versions. I will test in 2.2.0.GA soon.
            Reporter: Tim Evers


OK, so If we have Seam bean A and Seam bean B and Seam bean C;

A {
    @In
    B b

    @In
    C c

    public void doSomethingWithBs() {
        b.doSomething(); //IMPORTANT LINE 1
        c.doSomethingDifferent(); //IMPORTANT LINE 2
    }

    public MyDomainObj getCurrentObj() {
        return myVar;
    }
}

B {
    @In
    A a;

    public void doSomething() {
        process(a.getCurrentObj); //LINE THAT CAUSES BUG
    }

    private void process(MyDomainObj x) {
        ....
    }
}

OK, so the situation is this

on line marked with //IMPORTANT LINE 1 all injected variables are set. The method in Seam bean B gets executed and after that line of code has executed and the program is about to execute line marked with //IMPORTANT LINE 2 the injected variables are null. Thus I get a null pointer exception on variable c;

See my forum reference link for a more detailed example.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list