This content has been marked as final.
Show 2 replies
-
1. Re: Is it possible to have a Startup class for an .ear
raja05 Jun 7, 2004 1:14 PM (in response to tosenthu)startup class for the server? or for the webapp? Why dont u have a InitServlet and load-on-startup?
-
2. Re: Is it possible to have a Startup class for an .ear
ioparra Jul 21, 2004 9:57 AM (in response to tosenthu)next to your META-INF/application.xml, create a jboss-app.xml
add this "type" of entry<jboss-app> <module> <service>startup-service.xml</service> </module> </jboss-app>
create a startup-service.xml in the root directory of your EAR. this -service.xml is a standard mbean descriptor. Define a customized MBean that does whatever startup you want. During deployment, this mbean will be called and you can do any type of startup you want.
You may want to keep an eye on deployment ordering and make your mbean depends match your application requirement OR modify your MBean to listen to the startup mechanismserver.addNotificationListener(ServerImplMBean.OBJECT_NAME, this, null, null); } public void handleNotification(Notification msg, Object handback) { if( msg.getType().equals(Server.START_NOTIFICATION_TYPE) ) {
This didn't work for me on 3.2.1, but works for 3.2.5, you may need to play with this with the different version.
Good Luck!
-Ivan