[jboss-jira] [JBoss JIRA] Updated: (AS7-1921) <init-on-startup> in ejb-jar.xml doesn't suppress the EJB's @Startup annotation

Carlo de Wolf (JIRA) jira-events at lists.jboss.org
Sat Sep 24 04:19:26 EDT 2011


     [ https://issues.jboss.org/browse/AS7-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carlo de Wolf updated AS7-1921:
-------------------------------

         Issue Type: Enhancement  (was: Bug)
      Fix Version/s: 7.1.0.CR1
    Forum Reference: http://community.jboss.org/message/628245#628245, http://community.jboss.org/message/628245  (was: http://community.jboss.org/message/628245#628245, http://community.jboss.org/message/628245)


h6. EJB 3.1 FR 4.8.1
{quote}
By default, the container is responsible for deciding when to initialize a Singleton bean instance. However, the bean developer can optionally configure the Singleton for eager initialization.
{quote}

Technically this is not a bug. @Startup only mandates that the Singleton is started eagerly, the absence leaves it completely up to the container.

But the goal is to have it start lazily by our container.

> <init-on-startup> in ejb-jar.xml doesn't suppress the EJB's @Startup annotation
> -------------------------------------------------------------------------------
>
>                 Key: AS7-1921
>                 URL: https://issues.jboss.org/browse/AS7-1921
>             Project: Application Server 7
>          Issue Type: Enhancement
>          Components: EJB
>    Affects Versions: 7.0.2.Final
>         Environment: GNU/Linux Ubuntu 11.04 x86
>            Reporter: Pedro Kowalski
>            Assignee: Carlo de Wolf
>              Labels: ejb-jar.xml, ejb3.1,, init-on-startup, singleton, startup
>             Fix For: 7.1.0.CR1
>
>
> For a Singleton EJB defined as follows:
> @Singleton(name="MyInit")
> @Startup
> public class MyInit {
>     @PostConstruct
>     void init() {
>         System.out.println("=========== INITIALIZING! ===========");
>     }
> }
> and for ejb-jar.xml fragment defined as follows:
>  
> <session>
>    <ejb-name>MyInit</ejb-name>
>    <init-on-startup>false</init-on-startup>
> </session>
> The MyInit EJB is still initializing and you can still see the '======= INITIALIZING! =====' part in the logs.
> It seems that the <init-on-startup> element's value is not suppressing the @Startup annotation.
> Exemplary application: http://community.jboss.org/servlet/JiveServlet/download/628245-41501/StartupAS7.jar

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list