0 Replies Latest reply on Apr 15, 2002 3:39 PM by Peter Callies

    NameAlreadyBoundException

    Peter Callies Newbie

      When stopping and then starting a message-driven bean in 3.0, I get a NameAlreadyBoundException exception.

      It appears that the bean's environment references get setup as part of the start. Is there another lifecycle event that might make more sense to contain this? What is the implication of doing this in the create method?

      Or could the exception be caught and ignored (this feels bad because I'm not a proponent of eating exceptions)? After all, it's just telling me about something that I wanted to be bound anyway.

      2002-04-15 14:26:15,124 DEBUG [org.jboss.ejb.MessageDrivenContainer] Begin java:comp/env for EJB: HelloQueueMDB
      2002-04-15 14:26:15,124 DEBUG [org.jboss.ejb.MessageDrivenContainer] TCL: java.net.URLClassLoader@5f83e5
      2002-04-15 14:26:15,124 ERROR [org.jboss.ejb.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:664)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:650)
      at org.jboss.ejb.Container.setupEnvironment(Container.java:889)
      at org.jboss.ejb.Container.start(Container.java:547)
      at org.jboss.ejb.MessageDrivenContainer.start(MessageDrivenContainer.java:202)
      at org.jboss.ejb.Container.invoke(Container.java:770)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:447)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:805)
      at $Proxy1.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:309)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:447)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy19.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:396)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:447)
      at com.sun.jdmk.comm.HtmlInvokePage.buildPage(HtmlInvokePage.java:240)
      at com.sun.jdmk.comm.HtmlRequestHandler.processGetRequest(HtmlRequestHandler.java:325)
      at com.sun.jdmk.comm.HtmlRequestHandler.processRequest(HtmlRequestHandler.java:152)
      at com.sun.jdmk.comm.HtmlRequestHandler.doRun(HtmlRequestHandler.java:79)
      at com.sun.jdmk.comm.ClientHandler.run(ClientHandler.java:84)
      at java.lang.Thread.run(Thread.java:484)
      2002-04-15 14:26:15,134 ERROR [org.jboss.ejb.MessageDrivenContainer] root cause
      2002-04-15 14:26:15,134 ERROR [org.jboss.ejb.MessageDrivenContainer] Exception in service lifecyle operation: start
      org.jboss.deployment.DeploymentException: Could not set up environment; - nested throwable is: javax.naming.NameAlreadyBoundException; remaining name 'env'
      javax.naming.NameAlreadyBoundException; remaining name 'env'
      at org.jnp.server.NamingServer.createSubcontext(NamingServer.java:451)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:664)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:650)
      at org.jboss.ejb.Container.setupEnvironment(Container.java:889)
      at org.jboss.ejb.Container.start(Container.java:547)
      at org.jboss.ejb.MessageDrivenContainer.start(MessageDrivenContainer.java:202)
      at org.jboss.ejb.Container.invoke(Container.java:770)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:447)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:805)
      at $Proxy1.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:309)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:447)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy19.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:396)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:447)
      at com.sun.jdmk.comm.HtmlInvokePage.buildPage(HtmlInvokePage.java:240)
      at com.sun.jdmk.comm.HtmlRequestHandler.processGetRequest(HtmlRequestHandler.java:325)
      at com.sun.jdmk.comm.HtmlRequestHandler.processRequest(HtmlRequestHandler.java:152)
      at com.sun.jdmk.comm.HtmlRequestHandler.doRun(HtmlRequestHandler.java:79)
      at com.sun.jdmk.comm.ClientHandler.run(ClientHandler.java:84)
      at java.lang.Thread.run(Thread.java:484)