initialize-in-order in application.xml honored?
henk53 Jan 18, 2011 10:54 AMIt looks like the new initialize-in-order element in application.xml does not seem to be honored by JBoss AS 6.
I created a simple test ear module with a single web and ejb module. The EJB module only contains an (empty) bean. The Web module is basically empty.
The application.xml is:
<?xml version="1.0" encoding="UTF-8"?> <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" id="Application_ID" version="6"> <display-name>eartest</display-name> <initialize-in-order>true</initialize-in-order> <module> <web> <web-uri>eartestWeb.war</web-uri> <context-root>eartestWeb</context-root> </web> </module> <module> <ejb>eartestEJB.jar</ejb> </module> </application>
The result from this is:
16:28:25,226 INFO [TomcatDeployment] deploy, ctxPath=/ 16:28:25,283 INFO [BeanInstantiatorDeployerBase] Installed org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator@b4fb039 into MC at org.jboss.ejb.bean.instantiator/eartest/eartestEJB/MyBean 16:28:25,291 WARN [InterceptorInfoRepository] EJBTHREE-1852: InterceptorInfoRepository is deprecated 16:28:25,678 INFO [JBossASKernel] Created KernelDeployment for: eartestEJB.jar 16:28:25,683 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=eartest.ear,jar=eartestEJB.jar,name=MyBean,service=EJB3 16:28:25,683 INFO [JBossASKernel] with dependencies: 16:28:25,683 INFO [JBossASKernel] and demands: 16:28:25,683 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService; Required: Described 16:28:25,683 INFO [JBossASKernel] jboss-switchboard:appName=eartest,module=eartestEJB,name=MyBean; Required: Create 16:28:25,683 INFO [JBossASKernel] and supplies: 16:28:25,683 INFO [JBossASKernel] jndi:MyBean 16:28:25,687 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=eartest.ear,jar=eartestEJB.jar,name=MyBean,service=EJB3) to KernelDeployment of: eartestEJB.jar 16:28:25,770 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=eartest.ear,jar=eartestEJB.jar,name=MyBean,service=EJB3 16:28:25,776 INFO [EJBContainer] STARTED EJB: test.MyBean ejbName: MyBean 16:28:25,780 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI: 16:28:25,782 WARN [TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers 16:28:26,258 INFO [AbstractNoInterfaceViewBinder] Binding the following entry in Global JNDI for bean:MyBean eartest/MyBean/no-interface -> EJB3.1 no-interface view 16:28:26,263 INFO [TomcatDeployment] deploy, ctxPath=/eartestWeb 16:28:26,317 INFO [service] Removing bootstrap log handlers 16:28:26,394 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080 16:28:26,404 INFO [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009 16:28:26,406 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 19s:924ms
If I reverse the order of the modules in application.xml, the startup log is as follows:
16:30:35,759 INFO [TomcatDeployment] deploy, ctxPath=/ 16:30:35,821 INFO [BeanInstantiatorDeployerBase] Installed org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator@54170d32 into MC at org.jboss.ejb.bean.instantiator/eartest/eartestEJB/MyBean 16:30:35,829 WARN [InterceptorInfoRepository] EJBTHREE-1852: InterceptorInfoRepository is deprecated 16:30:36,187 INFO [JBossASKernel] Created KernelDeployment for: eartestEJB.jar 16:30:36,190 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=eartest.ear,jar=eartestEJB.jar,name=MyBean,service=EJB3 16:30:36,190 INFO [JBossASKernel] with dependencies: 16:30:36,191 INFO [JBossASKernel] and demands: 16:30:36,191 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService; Required: Described 16:30:36,191 INFO [JBossASKernel] jboss-switchboard:appName=eartest,module=eartestEJB,name=MyBean; Required: Create 16:30:36,191 INFO [JBossASKernel] and supplies: 16:30:36,191 INFO [JBossASKernel] jndi:MyBean 16:30:36,195 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=eartest.ear,jar=eartestEJB.jar,name=MyBean,service=EJB3) to KernelDeployment of: eartestEJB.jar 16:30:36,283 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=eartest.ear,jar=eartestEJB.jar,name=MyBean,service=EJB3 16:30:36,289 INFO [EJBContainer] STARTED EJB: test.MyBean ejbName: MyBean 16:30:36,293 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI: 16:30:36,295 WARN [TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers 16:30:36,793 INFO [AbstractNoInterfaceViewBinder] Binding the following entry in Global JNDI for bean:MyBean eartest/MyBean/no-interface -> EJB3.1 no-interface view 16:30:36,799 INFO [TomcatDeployment] deploy, ctxPath=/eartestWeb 16:30:36,855 INFO [service] Removing bootstrap log handlers 16:30:36,933 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080 16:30:36,944 INFO [org.apache.coyote.ajp.AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009 16:30:36,945 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.Final "Neo"] Started in 21s:835ms
As can be seen, there isn't any difference and the EJB module always seems to startup first.