0 Replies Latest reply on Dec 14, 2003 8:52 PM by andy999

    NameAlreadyBoundException deploying ear on 3.2.1

    andy999 Newbie

      Hi

      I'm trying to deploy hibernate as a sar within an ear and I keep getting a
      javax.naming.NameAlreadyBoundException.

      Here is my jboss-app.xml

      <jboss-app>
      <loader-repository>trafficlite:loader=trafficlite.ear</loader-repository>


      hibernate.sar


      </jboss-app>

      Jboss-service.xml



      jboss.jca:service=RARDeployer

      //omitted

      java:/comp/env/Hibernate/SessionFactory
      java:/HibTrafficliteDS
      net.sf.hibernate.dialect.MySQLDialect
      true
      false
      UserTransaction
      net.sf.hibernate.transaction.JTATransactionFactory
      net.sf.hibernate.transaction.JBossTransactionManagerLookup



      and here is the resulting deployment output and stacktrace

      12:07:09,284 INFO [EjbModule] Starting
      12:07:09,286 INFO [EjbModule] Started
      12:07:09,287 INFO [EJBDeployer] Deployed: file:/usr/local/jboss-3.2.1/server/default/tmp/deploy/server/default/deploy/trafficlite.ear/37.trafficlite.ear-contents/trafficlite-ejb.jar
      12:07:09,771 INFO [jbossweb] Registered jboss.web:Jetty=0,JBossWebApplicationContext=8,context=/trafficlite
      12:07:09,805 INFO [jbossweb] Extract jar:file:/usr/local/jboss-3.2.1/server/default/tmp/deploy/server/default/deploy/trafficlite.ear/37.trafficlite.ear-contents/trafficlite.war!/ to /tmp/Jetty_0_0_0_0_8080__trafficlite/webapp
      12:07:10,658 WARN [jbossweb] WARNING: Configuration error on jar:file:/usr/local/jboss-3.2.1/server/default/tmp/deploy/server/default/deploy/trafficlite.ear/37.trafficlite.ear-contents/trafficlite.war!/
      javax.naming.NameAlreadyBoundException; remaining name 'env'
      at org.jnp.server.NamingServer.createSubcontext(NamingServer.java:451)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:811)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:797)
      at org.jboss.web.AbstractWebContainer.parseWebAppDescriptors(AbstractWebContainer.java:505)
      at org.jboss.web.AbstractWebContainer$DescriptorParser.parseWebAppDescriptors(AbstractWebContainer.java:935)
      at org.jboss.jetty.JBossWebApplicationContext.setUpENC(JBossWebApplicationContext.java:342)
      at org.jboss.jetty.JBossWebApplicationContext.startHandlers(JBossWebApplicationContext.java:301)
      at org.mortbay.http.HttpContext.start(HttpContext.java:1798)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:421)
      at org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationContext.java:85)
      at org.jboss.jetty.JBossWebApplicationContext.start(JBossWebApplicationContext.java:89)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:331)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:242)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:357)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)

      12:07:10,667 INFO [jbossweb] Stopped WebApplicationContext[/trafficlite,Traffic Lite]
      12:07:10,669 INFO [jbossweb] Deregister jboss.web:Jetty=0,JBossWebApplicationContext=8,context=/trafficlite
      12:07:10,671 INFO [jbossweb] Successfully undeployed file:/usr/local/jboss-3.2.1/server/default/tmp/deploy/server/default/deploy/trafficlite.ear/37.trafficlite.ear-contents/trafficlite.war
      12:07:10,672 ERROR [MainDeployer] could not start deployment: file:/usr/local/jboss-3.2.1/server/default/tmp/deploy/server/default/deploy/trafficlite.ear/37.trafficlite.ear-contents/trafficlite.war
      org.jboss.deployment.DeploymentException: - nested throwable: (javax.naming.NameAlreadyBoundException; remaining name 'env')
      at org.jboss.jetty.Jetty.deploy(Jetty.java:353)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:242)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:357)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:458)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)
      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:811)
      at org.jnp.interfaces.NamingContext.createSubcontext(NamingContext.java:797)
      at org.jboss.web.AbstractWebContainer.parseWebAppDescriptors(AbstractWebContainer.java:505)
      at org.jboss.web.AbstractWebContainer$DescriptorParser.parseWebAppDescriptors(AbstractWebContainer.java:935)
      at org.jboss.jetty.JBossWebApplicationContext.setUpENC(JBossWebApplicationContext.java:342)
      at org.jboss.jetty.JBossWebApplicationContext.startHandlers(JBossWebApplicationContext.java:301)
      at org.mortbay.http.HttpContext.start(HttpContext.java:1798)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:421)
      at org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationContext.java:85)
      at org.jboss.jetty.JBossWebApplicationContext.start(JBossWebApplicationContext.java:89)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:331)
      ... 18 more

      Is there any dependencies that I'm missing??

      cheers
      andy