[jboss-user] [Snowdrop] - Destroy-method not getting called when JBossAS is shutdown

Zemian Deng do-not-reply at jboss.com
Sun Jul 29 22:24:03 EDT 2012

Zemian Deng [https://community.jboss.org/people/saltnlight5] created the discussion

"Destroy-method not getting called when JBossAS is shutdown"

To view the discussion, visit: https://community.jboss.org/message/750867#750867

Hi there,

I have successfully deployed the snowdrop into JBossAS 7.1.1.FINAL, and I can deploy a simple spring application with jboss-spring.xml as this:

    <bean id="helloService" class="deng.HelloService" init-method="start" destroy-method="stop">

My HelloService is a simple one like this:

package deng;
import org.slf4j.*;
import java.util.concurrent.atomic.*;
public class HelloService {
          private static Logger logger = LoggerFactory.getLogger(HelloService.class);
          private AtomicBoolean started = new AtomicBoolean(false);
          public boolean isStarted() { return started.get(); }
          public void start() { started.set(true); logger.info("started."); }
          public void stop() { started.set(false); logger.info("stopped."); }

When I package this into my.jar, the server deployed it fine. However when I shutdwon the server with CTRL+C (or with CLI), the stop() is never called. Is this a bug?

Zemian Deng

Reply to this message by going to Community

Start a new discussion in Snowdrop at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120729/b89a02a9/attachment.html 

More information about the jboss-user mailing list