You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Jarek Gawor (JIRA)" <ji...@apache.org> on 2010/09/02 22:06:53 UTC

[jira] Resolved: (OPENEJB-1348) Circular @Startup singleton dependencies

     [ https://issues.apache.org/jira/browse/OPENEJB-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarek Gawor resolved OPENEJB-1348.
----------------------------------

         Assignee: Jarek Gawor
    Fix Version/s: 3.2
       Resolution: Fixed

Committed the patch with some minor changes to trunk (revision 992094). 


> Circular @Startup singleton dependencies
> ----------------------------------------
>
>                 Key: OPENEJB-1348
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1348
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: (trunk/openejb3)
>            Reporter: Jarek Gawor
>            Assignee: Jarek Gawor
>             Fix For: 3.2
>
>         Attachments: OPENEJB-1348.patch
>
>
> Singleton ejbs with @Startup that have circular dependencies on each other (e.g. via @EJB injection) will fail to deploy. For example:
> @Singleton @Startup
> class Foo {
>   @EJB Bar bar;
> }
> @Singleton @Startup
> class Bar {
>  @EJB Foo foo;
> }
> The Assembler.java tries to deploy the ejbs in the right order and it calls Container.deploy(). The SingletonContainer.deploy() does two things: 1) it registers the ejb in its registry and 2) instantiates the bean if the bean has @Startup. If the @Startup bean has circular dependencies on some other bean (e.g. via @EJB injection) the deployment will fail since the dependent bean has not been deployed yet. The solution to this problem is to split the ejb registration and instantiation into two separate methods. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.