EJB's are driven by a request. They don't exist all by themselves in memory unless something is using them (well they do, but they really are passive components that only become active when requested). So if in a J2EE application you want something like the Quartz scheduler to start up automatically when the system starts up or when your application is deployed, you have a few choices. One is an initializer servlet (QuartzInitializer), another is a Web application Lifecycle listener (Quartz provides one of these as well but I don't remember the class), and another in Glassfish is a application server Lifecycle listener.
I chose to use the Quartz provided QuartzInitializer servlet. When my application server starts up and my application is deployed, this servlet will be run which will start the Quartz scheduler.
[Message sent by forum member 'bbergquist' (bbergquist)]
http://forums.java.net/jive/thread.jspa?messageID=235814