How can I collocate EJBs with CORBA objects?

The work required, if you are willing to use the standalone EJB container, is fairly minimal:

  1. Write a main program.
  2. Run the container (new Container().run(args)) from within the main program, setting a system property EJBNoSleep, causing the EJB container to not block the current thread.
  3. Obtain the EJB container's ORB via the following call:
  4. orb = (org.omg.CORBA.ORB) context.lookup("java:comp/ORB");
    
  5. Instantiate your CORBA servers, putting them into JNDI (or use CosNaming, if you prefer).
  6. Access the CORBA objects from within your EJBs using JNDI.