Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

JMX to start and EJB Timer

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

Thanks,
David
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic