[jboss-user] [Management, JMX/JBoss] - dependency problem between MBean and EJB...

flios do-not-reply at jboss.com
Mon Apr 9 15:01:41 EDT 2007


Hi there, 

I'm creating a sample J2EE application with JBoss, with some EJBs and some MBeans. 

What I would like is simple : the "create" callback of my MBean sould call a method from a session bean. 

I saw that in the FAQ : http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanAnMBeanDependOnASessionBean

I made what was written : putting the dependency in the jboss.service.xml ; but it doesn't work... The problem may be that the MBean and the EJBs are in the same jar file. So I tried to organize differently my .ear file : 


  | mySample.ear
  |   - META-INF
  |       - application.xml
  |       - jboss-app.xml
  |    - mySampleMBeans.jar
  |       - ...
  |       - Toto.class               <- the MBean implementation
  |       - TotoMBean.class          <- the MBean interface
  |       - ...
  |    - myEJBs.jar
  |       - META-INF
  |          - persistence.xml
  |       - ...
  |       - myFacade.class               <- the Session Bean implementation
  |       - myFacadeRemote.class         <- the Session Bean interface
  |       - ...
  |    - mySampleMBeans.sar
  |       - META-INF
  |          - jboss-service.xml
  | 

I put in jboss-service.xml : 


  | <?xml version="1.0"?>
  | <server>
  | 	<mbean code="com.xxx.yyy.jmx.Toto" name="XXXX:service=Toto">
  |                 <depends>
  |                     jboss:service=Naming
  |                 </depends>
  |                 <depends>
  |                     jboss.j2ee:module=myEJBs.jar,service=EjbModule
  |                 </depends>
  | 	</mbean>   
  | </server>
  | 

The result is that the Toto MBean is never started... (this means that the dependency exists, but not on the good module !!)

Any idea ? 

Thx !!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035790#4035790

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035790



More information about the jboss-user mailing list