Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to start an EJB automatically  RSS feed

 
Marcel de Jong
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to start an EJB without a specific call to it. When the EJB is deployed within the application server I want that the EJB calls a specific method.
I've tried to put it in ejbCreate, but this only fired when the EJB is created, hence the name
An option I am thinking about is writing a seperate application which calls the EJB, but this means another application.
Any ideas?
Thanks in advance.
Marcel
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An EJB isn't "runnable". It's roughly the equivalent of a Windows DLL in that its a collection of methods that can be called.
A common technique for stuff like this is to employ a "null" servlet - one that is configured to start when the appserver starts. The "null" servlet doesn't handle Http requests, it just takes advantage of the fact that its init() method is going to be called. So your init() method could locate and invoke the EJB.
However, you didn't actuall SAY "startup", you said "deploy". Originally you couldn't deploy when the server was up, so this would be a an impossible situation. Nowadays you may "hot-deploy" many appservers, but as far as I know no one's supplied any APIs that track such things.
 
ipog
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not try start up class in weblogic app server?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!