*
The moose likes Java in General and the fly likes JMX to start and EJB Timer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JMX to start and EJB Timer" Watch "JMX to start and EJB Timer" New topic
Author

JMX to start and EJB Timer

David McWilliams
Ranch Hand

Joined: Mar 14, 2009
Posts: 73
Hi all,

I have a large java application (deployed as an ear file). The application consists of a daemon class that creates an ejb timer. The timer does some processes every day. I am having a problem in that the timer occasionally stops. The only way to restart the timer, and hence the processing, is to restart the Sun app server.

To solve this problem, I am investigating the use of JMX. I am hoping to use JMX to call an existing method called startDaemon(). This methos restarts the ejb timer programmatically.

To add JMX to the application, I have turned the existing daemon bean into an MBean. I have then created a class called 'Main' that is used to register the daemon MBean to the MBean server. This class holds a 'main' method. I then hope to call the startDaemon() method via JConsole.

Does anyone know if I am going in the right direction? Does this solution sound feasible?


The problem I am having is that I cannot get the JMX property set, e.g.

Exception in thread "main" java.lang.NoClassDefFoundError: myApp.ear

Any suggestions are welcome. I am new to JMX.

Thanks,
David
 
jQuery in Action, 2nd edition
 
subject: JMX to start and EJB Timer
 
Similar Threads
TimerService in JBoss 4.0.5
The advantages of using JMX?
jsp cant call bean in websphere
timer mbean call to ejb
Advantage of using JMX?