I have the following issue in JBoss 4.x.
I have a custom startup class which is supposed to run when we start the server. I have a message in the class which should print just before Started in 29s:750ms (This is the last line when u start the server).
I can handle this with Mbean and jboss-service.xml. But I have some dependency classes in my ear file which talks to this startup class. So, I had to put in EAR.
So, the issue is - is it possible to put the startup class in EAR and configure somewhere so that the server reads my custom class and prints the message when I just start the server.
(Note: If I configure the startup class name in jboss-service.xml by placing my class in EAR file, it does not work. Because, jboss-service.xml deploys first then the EAR file as soon as I start the server)
Thanks in advance.
You can configure a startup servlet in web.xml file. The init() method gets called during application startup and destroy() when application is shutdown.
Let me know if you need more details.