Are service archives (sar), jboss-service.xml, JBoss MBeans, jboss-beans.xml recommended in JBoss EAP 6+
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
- 6.x
Issue
- Are service archives (sar) recommended in JBoss EAP 6?
- Are jboss-service.xml JBoss MBeans recommended in JBoss EAP 6?
- Are jboss-beans.xml recommended in JBoss EAP 6?
- We are migrating our application from EAP 5 to EAP 6 and found that our jboss-service.xml configuration is not valid anymore.
Resolution
No. The JBoss Service Archive (sar) / jboss-service.xml, and JBoss MC Beans (jboss-beans.xml) are not part of the Java EE specification. In older JBoss versions, MBeans were part of the core architecture, and the sar deployments were used by JBoss Application server. After a large change in internal architecture in EAP 6, this is no longer the case. Functionality performed with sars/jboss-service.xml/jboss-beans.xml previously is now done differently. For MBeans/singletons you should use the Java EE 6 @Singleton.
Also note that the EAP management model that is exposed as MBeans (such as an MBean for an EJB component, messaging component, etc) do not support dependencies on them. MBean dependencies can only be declared for MBeans created by sars / jboss-service.xml, platform MBeans, or other custom MBeans.
See the article below which shows how you can use portable JavaEE @Singleton to create the JBoss MBean equivalent which is exposed in JNDI and can also be exposed in JMX.
How to expose a JavaEE 6 Singleton as a MBean in JMX in JBoss EAP 6
How to change a jboss-service.xml / sar MBean Singleton to a Java EE 6 Singleton in JBoss EAP 6
Related Articles
How to create a SAR archive in EAP6
How to expose a Java EE Singleton as a MBean in JMX in JBoss EAP
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.