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() { } }
<mbean code="project.DataProvider" name="project:service=dataprovider"> <depends>jboss.ha:service=HASingletonDeployer,type=Barrier</depends> </mbean>
Forgot some relevant details:
I am using Jboss 4.0.5.GA installed with 1.2.0.GA jems installer, with ejb3-clustered configuration.