This week's book giveaway is in the Security forum.
We're giving away four copies of Penetration Testing Basics and have Ric Messier on-line!
See this thread for details.
Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

timer mbean call to ejb

Lidia Cyc
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i have to build a following code module:
a timer mbean calls after every pre-set time interval a listener implementing NotificationListener, which should trigger a business method of a slsb.

i have two problems:

1. i need the mbean to start the calls automatically. but jmx server is loaded before the application server, and therefore any attempt to call a sessionbean from the listener will fail due to the lack of application context. what is the right solution for this issue? should i build a slsb which will register the mbean programatically and run the mbean's method that sends a notification after the registration?

2. if i try to run mbean's method that sends a notification to the listener manually (by using administration control panel) when the app server is running, the listener still fails to make a jndi name lookup of the slsb's name, throwing an exception that it's not running in the app.server's environment. i guess the listener instance, registered with mbean, is created in jmx server too. but shouldn't there be a way to get a reference to the app.server context also from the jmx server?

thank you for your time!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic