Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes JBoss/WildFly and the fly likes Startup/Shutdown class in JBOSS 4.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Startup/Shutdown class in JBOSS 4.0" Watch "Startup/Shutdown class in JBOSS 4.0" New topic

Startup/Shutdown class in JBOSS 4.0

Rajesh MadhanGopal
Ranch Hand

Joined: Jan 19, 2006
Posts: 70

Could someone tell me how to write a simple startup class which would start when i start the app server.

The following are the steps i performed :

1. Wrote a Mbean interface.
2. Wrote a Startup class implementing the Mbean interface.
3. Created a JAR of the 2 class files.

Now, where do i add the JAR file and also where is the jboss-service.xml in which i need to make an entry for the MBean.

Thanks<br />Rajesh
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17260

jboss-service is located in the server/yourConfig/conf directory.

You would place the jar file in the deploy directory of server/yourConfig directory. "yourConfig" is whatever you are using. It might be minimal, default, all, or a copy of one of those that you customized for your environment (which is highly recommended to do).


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Startup/Shutdown class in JBOSS 4.0