11 Replies Latest reply on Jan 7, 2010 4:58 PM by Andrew Rubinger

    How do I access the JBoss Kernel from an EJB3?

    Eric Wittmann Newbie

      I have a stateless EJB that needs access to the JBoss org.jboss.kernel.Kernel object.  In the JBoss microcontainer world I would inject the kernel into my bean using "jboss.kernel:service=Kernel".  How can I get the kernel injected into my EJB3 though?  I've tried a number of options without much success.

       

      My EJB is pretty standard:

       

      @Stateless

      @Local(IMyBeanLocal.class)

      @Remote(IMyBeanRemote.class)

      @TransactionManagement(TransactionManagementType.CONTAINER)
      public class MyBean implements IMyBeanLocal, IMyBeanRemote {
         private Kernel kernel;
         public void doSomething() {
            System.out.println("did it: " + kernel);
         }
      }
      Thanks for any help.