• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to auto execute a session bean’s method on ear deployment?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a way to have a session bean's method executed periodically every week at a certain time. I am thinking of using the quartz scheduler to do this. My question is, how do I start the scheduler to run from the moment the .ear file is deployed automatically? Is there any annotation that I can use on the stateless session bean calling the scheduler.start method such as @PostConstruct or something?
 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know you can set a servlet to init/load automatically on ear deployment. Not sure how to do so for an EJB. You could always write a servlet which calls your EJB.
 
Sib Pete
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you set up a servlet to load automatically on ear deployment?
 
Jeanne Boyarsky
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sib Pete wrote:How do you set up a servlet to load automatically on ear deployment?


In the web.xml. See this example
 
Sib Pete
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I cant auto execute an ejb method on deployment, then I will have to go with this I guess. Thanks. Really helps a lot.
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any update on this Sib?

My enterprise application only has a backend, and all ive found on the net is using servlet to initialise the scheduler.
My goal is to automate method invocation on one of my stateless session beans, periodically via cron trigger.

Any clues?
    Bookmark Topic Watch Topic
  • New Topic