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
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015709#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...