2 Replies Latest reply on Jun 7, 2007 1:28 PM by Brian Something

    Get an MBean to start on JBoss startup

    Brian Something Newbie

      I am using jboss4.0.4 installed with ejb3.

      I would like to get an MBean's start() method to run as JBoss is starting up. Right now, the only way I know how to do this is to add the following to my %JBOSS_HOME%/server/default/conf/jboss-service.xml file:

      <mbean code="com.example.ClassPreloadService" name="jboss.mx:service=ClassPreloadService" xmbean-dd="">
       <xmbean>
       <operation>
       <name>start</name>
       </operation>
       </xmbean>
      </mbean>


      Is there a way I can do this with annotations?

      If not, I'm sure that editing %JBOSS_HOME%/server/default/conf/jboss-service.xml is not a good idea in the long run. What is the best practice for doing this?

      Thanks for looking!