I want to precise my problem. During startup, I initialize my Corba Orb and store it in the servlet context. I've still no idea how I can solve this in EJB.
Should I write just a singleton object which returns the Orb? How can I initialize the Orb during startup of JBoss?
As far as I can tell this cannot be done. Session beans are a service and only become available once a service start. There is no "starting point" like an init() method, at least as far as I can tell. However, you can approximate the behavior with a static property/method call of a shared library. If you put a library in /lib/ext, then the first time a session bean make a call, it will be initialized. Other session beans will be able to grab the same reference.
What about writing an MBean which does some core initialization and stores common objects in JNDI?
Where can I find information about writing my own mbeans which fit in the jBoss architecture?