Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JMX to start and EJB Timer  RSS feed

Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!