| Author |
EJB container - how to initialize a class at server startup ?
|
Alex M. De Luca
Greenhorn
Joined: Jun 04, 2008
Posts: 1
|
|
|
I am using EJB3 and I need to call a class that initializes some configuration when the EJB container is initialized. This must be done before any EJB is called. Is there any way to do that ? I thought I could use something like the servlet container's context listener, but there isn't anything like that in the EJB container. Does anybody have a suggestion ?
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26158
|
|
Alex, There isn't a "load on startup" type thing that I know of. Why not make a class that does the initial configuration and make it a static variable in your EJB. This will guarantee it runs before the EJB is called.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26158
|
|
|
And welcome to JavaRanch!
|
 |
 |
|
|
subject: EJB container - how to initialize a class at server startup ?
|
|
|