This content has been marked as final.
Show 4 replies
-
1. Re: How do force the module org.jboss.ejb.EjbModule to be de
dimitris Feb 12, 2007 12:10 PM (in response to krimsonnitehawk)You just need to put a dependency in the META-INF/jboss.xml descriptor on the target mbean (see the jboss-4_0.dtd)
-
2. Re: How do force the module org.jboss.ejb.EjbModule to be de
krimsonnitehawk Feb 13, 2007 5:55 AM (in response to krimsonnitehawk)Hi, thanks for getting back. I've tried putting the following code inside the META-INF/jboss.xml file
<container-configurations> <container-configuration> <container-name>Schema Update Dependent</container-name> <depends>package.myclass:service=servicename</depends> </container-configuration> </container-configurations>
Is this the correct place for the depends tag, or should it be within one of the tags as defined in the dtd? In jboss_4_0.dtd it says "The standard configurations will automatically be used if no custom configuration is specified." Do I need to more elements within my custom container-configuration tag so that jboss will pick it up instead of using one of the defaults defined in jboss4/server/default/conf/standardjboss.xml. How do find out which container configuration jboss is using to deploy my ejb module? I think the above code is currently being ignored.
When I deploy my ear the ejb module still seems to deploy even although I have called stop on the service. I am wondering if the stop isn't actually stopping my service. I have the following code in my service class.
First the interface.package package.myclass; public interface ServiceMBean { public void start() throws Exception; public void stop() throws Exception; public void create() throws Exception; public void destroy() throws Exception; }
The service class -package package.myclass; public class Service implements ServiceMBean{ public void start() throws Exception { //the important bit ObjectName ServiceSARClass = new ObjectName("package.myclass:service=servicename"); // to get a handle on the MBeanServer MBeanServer server = MBeanServerLocator.locateJBoss(); // if an exception occurs within the code server.invoke(ServiceSARClass,"stop",null,null); } public void destroy() throws Exception { logger.debug("Destroying jboss:service=servicename"); } public void stop() throws Exception { logger.debug("Stopping jboss:service=servicename"); } public void create() throws Exception { }
Calling server.invoke(ServiceSARClass,"stop",null,null); seems to call the stop method of this class but my debug shows that the start method contiunes to run. All my stop method contains is some debug - do I need more code to get actually get the service to stop? I am aware that stop simply un-registers the MBean from the MBeanServer. Is this enough so that when the ejb module deploys it see that its dependency has failed and in turn stops its deployment?
Again thanks in advance for any help!
Andy -
3. Re: How do force the module org.jboss.ejb.EjbModule to be de
krimsonnitehawk Feb 13, 2007 5:56 AM (in response to krimsonnitehawk)hi,
Is this the correct place for the depends tag, or should it be within one of the tags as defined in the dtd?
should read..
Is this the correct place for the depends tag, or should it be within one of the<entity/>
tags as defined in the dtd? -
4. Re: How do force the module org.jboss.ejb.EjbModule to be de
dimitris Feb 14, 2007 4:52 AM (in response to krimsonnitehawk)If your mbean service fails with an exception in the start method, then jboss will assume it has FAILED and so all dependend mbeans (including the EJB container) will never start.
Normally we don't manually call stop() after a failled start().