1 Reply Latest reply on Apr 7, 2007 3:21 PM by Dok Tora

    MBean -> HASingletonSupport and no injection

    Dok Tora Newbie

      Hi,

      I converted an MBean to an HASingleton. The result was that injection via annotation stopped working (ex: @EJB and @PersistenceContext).

      Is this a "feature" or misconfiguration on my part?

      Here is some code. Before, DataProvider used to implement MBeanRegistration.

      // The interface
      public interface DataProviderMBean extends HASingletonMBean {
       public void startSingleton();
       public void stopSingleton();
      }
      
      // The implementation
      public class DataProvider extends HASingletonSupport implements DataProviderMBean
      {
       @PersistenceContext(unitName = "client")
       protected EntityManager em;
      
       @EJB SystemSettings sys;
      
      
       public void startSingleton()
       {
       System.out.println(em);
       System.out.println(sys);
       }
      
       public void stopSingleton()
       {
       }
      }



      from jboss-service.xml:
      ----------------------
      <mbean code="project.DataProvider" name="project:service=dataprovider">
       <depends>jboss.ha:service=HASingletonDeployer,type=Barrier</depends>
       </mbean>


      Has anyone encountered this before. It seems illogical to me and is quite frustrating.

      cheers!
      -- doktora