3 Replies Latest reply on Feb 26, 2003 11:16 AM by Richard Maher

    Start/stop support for MessageDrivenBeans

    Rui Afonso Newbie


      Hi there,

      I've been looking for a way to be able to start and stop
      a MessageDrivenBean using the jmx-console. There's no
      trouble in stopping it, but when I try to restart, it
      throws the exception documented below.
      I believe I must extend the ServiceMBeanSupport but I
      don't have the faintest ideia of what methods and behaviours are necessary to put it into work.
      An example would be great...

      12:11:38,558 ERROR [MessageDrivenContainer] Could not set up environment
      javax.naming.NameAlreadyBoundException; remaining name 'env'
      at org.jnp.server.NamingServer.createSubcontext(NamingServer.java:451)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:797)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:783)
      at org.jboss.ejb.Container.setupEnvironment(Container.java:871)
      at org.jboss.ejb.Container.start(Container.java:566)
      at org.jboss.ejb.MessageDrivenContainer.start(MessageDrivenContainer.java:197)
      at org.jboss.ejb.Container.invoke(Container.java:756)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:227)
      at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:196)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:183)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:78)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:60)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:581)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
      at org.mortbay.http.HttpServer.service(HttpServer.java:875)
      at org.jboss.jetty.Jetty.service(Jetty.java:543)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:203)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
      at java.lang.Thread.run(Thread.java:536)
      12:11:38,561 ERROR [MessageDrivenContainer] root cause
      12:11:38,581 WARN [jbossweb] WARNING: Exception for /jmx-console/HtmlAdaptor
      MBeanException: Exception in service lifecyle operation: start
      Cause: org.jboss.deployment.DeploymentException: Could not set up environment; - nested throwable: (javax.naming.NameAlreadyBound
      Exception; remaining name 'env')
      at org.jboss.ejb.Container.invoke(Container.java:775)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:227)
      at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:196)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:183)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:78)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:60)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:581)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
      at org.mortbay.http.HttpServer.service(HttpServer.java:875)
      at org.jboss.jetty.Jetty.service(Jetty.java:543)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:203)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
      at java.lang.Thread.run(Thread.java:536)
      + nested throwable:
      org.jboss.deployment.DeploymentException: Could not set up environment; - nested throwable: (javax.naming.NameAlreadyBoundExcepti
      on; remaining name 'env')
      at org.jboss.ejb.Container.setupEnvironment(Container.java:1066)
      at org.jboss.ejb.Container.start(Container.java:566)
      at org.jboss.ejb.MessageDrivenContainer.start(MessageDrivenContainer.java:197)
      at org.jboss.ejb.Container.invoke(Container.java:756)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:227)
      at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:196)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:183)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:78)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:60)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:293)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:581)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1687)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1637)
      at org.mortbay.http.HttpServer.service(HttpServer.java:875)
      at org.jboss.jetty.Jetty.service(Jetty.java:543)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:806)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:956)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:823)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:203)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:290)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
      at java.lang.Thread.run(Thread.java:536)
      Caused by: javax.naming.NameAlreadyBoundException; remaining name 'env'
      at org.jnp.server.NamingServer.createSubcontext(NamingServer.java:451)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:797)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:783)
      at org.jboss.ejb.Container.setupEnvironment(Container.java:871)
      ... 26 more