javax.naming.NameNotFoundException: Cannot find name to unbind

Oracle Community | joseguerra | 6 years ago
  1. 0

    Glassfish 3.1 exception using ActiveMQ RA

    Oracle Community | 6 years ago | joseguerra
    javax.naming.NameNotFoundException: Cannot find name to unbind
  2. 0

    Deploy EJB in multiple wars to same app server (Glassfish)

    Stack Overflow | 3 years ago | sdoca
    javax.naming.NameNotFoundException: Cannot find name to unbind
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Original Java.net forum thread is http://www.java.net/forum/topic/glassfish/glassfish/namenotfoundexception-thrown-during-undeployment-war-containing-ejbs --- The following exception stacktrace was produced during undeployment of a Web Archive containing EJBs with an explicit global and portable JNDI name: [#|2011-09-26T17:39:47.229+0530|WARNING|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=20;_ThreadName=Thread-4;|WEB0610: [/WebEJBExample] failed to unbind namespace javax.naming.NameNotFoundException: Cannot find name to unbind at com.sun.enterprise.naming.impl.TransientContext.doUnbind(TransientContext.java:398) at com.sun.enterprise.naming.impl.TransientContext.unbind(TransientContext.java:420) at com.sun.enterprise.naming.impl.TransientContext.unbind(TransientContext.java:424) at com.sun.enterprise.naming.impl.TransientContext.unbind(TransientContext.java:424) at com.sun.enterprise.naming.impl.SerialContextProviderImpl.unbind(SerialContextProviderImpl.java:124) at com.sun.enterprise.naming.impl.SerialContext.unbind(SerialContext.java:740) at javax.naming.InitialContext.unbind(InitialContext.java:416) at javax.naming.InitialContext.unbind(InitialContext.java:416) at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.unpublishObject(GlassfishNamingManagerImpl.java:246) at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl.unbindFromComponentNamespace(ComponentEnvManagerImpl.java:355) at com.sun.enterprise.web.WebModuleContextConfig.unbindFromComponentNamespace(WebModuleContextConfig.java:454) at com.sun.enterprise.web.WebModuleContextConfig.stop(WebModuleContextConfig.java:447) at com.sun.enterprise.web.WebModuleContextConfig.lifecycleEvent(WebModuleContextConfig.java:174) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:149) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5603) at com.sun.enterprise.web.WebModule.stop(WebModule.java:527) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1049) at com.sun.enterprise.web.WebContainer.unloadWebModule(WebContainer.java:2211) at com.sun.enterprise.web.WebContainer.unloadWebModule(WebContainer.java:2166) at com.sun.enterprise.web.WebApplication.stop(WebApplication.java:159) at org.glassfish.internal.data.EngineRef.stop(EngineRef.java:169) at org.glassfish.internal.data.ModuleInfo.stop(ModuleInfo.java:302) at org.glassfish.internal.data.ApplicationInfo.stop(ApplicationInfo.java:322) at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:999) at com.sun.enterprise.v3.server.ApplicationLifecycle.undeploy(ApplicationLifecycle.java:1025) at org.glassfish.deployment.admin.UndeployCommand.execute(UndeployCommand.java:330) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:662) |#] The error appears to occur when Glassfish attempts to undeploy the web module after undeploying the EJB module. The EJB module appears to be the one that owns the portable JNDI name, and when the web module attempts to unbind the non-existent JNDI name, the afore-mentioned exception is thrown. This has grave consequences in a more complicated scenario (like the usage of Hibernate as a JPA provider within the application), as the web-module does not appear to be completely undeployed, resulting in vague exceptions being thrown on a subsequent deployment and use of the application. Surprisingly, the exception is not thrown when the EJB module is packaged in a EAR file, as an ejb-jar file. Also, no exceptions are thrown when no portable JNDI names are specified for the EJB using the @EJB annotation. A testcase (an Eclipse project) to reproduce this is attached.

    Java.net JIRA | 5 years ago | Vineet Reynolds
    javax.naming.NameNotFoundException: Cannot find name to unbind
  5. 0

    NameNotFoundException thrown during undeployment of a WAR containing EJBs

    Oracle Community | 5 years ago | Vineet.Reynolds
    javax.naming.NameNotFoundException: Cannot find name to unbind

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.naming.NameNotFoundException

      Cannot find name to unbind

      at com.sun.enterprise.naming.impl.TransientContext.doUnbind()
    2. Glassfish Naming
      SerialContext.unbind
      1. com.sun.enterprise.naming.impl.TransientContext.doUnbind(TransientContext.java:398)
      2. com.sun.enterprise.naming.impl.TransientContext.unbind(TransientContext.java:420)
      3. com.sun.enterprise.naming.impl.SerialContextProviderImpl.unbind(SerialContextProviderImpl.java:124)
      4. com.sun.enterprise.naming.impl.SerialContext.unbind(SerialContext.java:740)
      4 frames
    3. Java RT
      InitialContext.unbind
      1. javax.naming.InitialContext.unbind(InitialContext.java:416)
      2. javax.naming.InitialContext.unbind(InitialContext.java:416)
      2 frames
    4. Glassfish Naming
      GlassfishNamingManagerImpl.unpublishObject
      1. com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.unpublishObject(GlassfishNamingManagerImpl.java:246)
      1 frame
    5. Connectors Private APIs for GlassFish Containers
      ResourceNamingService.unpublishObject
      1. com.sun.appserv.connectors.internal.api.ResourceNamingService.unpublishObject(ResourceNamingService.java:184)
      1 frame
    6. Connectors Runtime
      AdminObjectResourceDeployer.redeployResource
      1. com.sun.enterprise.connectors.service.ConnectorAdminObjectAdminServiceImpl.deleteAdminObject(ConnectorAdminObjectAdminServiceImpl.java:103)
      2. com.sun.enterprise.connectors.ConnectorRuntime.deleteAdminObject(ConnectorRuntime.java:1154)
      3. com.sun.enterprise.resource.deployer.AdminObjectResourceDeployer.deleteAdminObjectResource(AdminObjectResourceDeployer.java:153)
      4. com.sun.enterprise.resource.deployer.AdminObjectResourceDeployer.undeployResource(AdminObjectResourceDeployer.java:146)
      5. com.sun.enterprise.resource.deployer.AdminObjectResourceDeployer.redeployResource(AdminObjectResourceDeployer.java:192)
      5 frames
    7. Container Common
      ResourceManager$PropertyChangeHandler.changed
      1. org.glassfish.javaee.services.ResourceManager$PropertyChangeHandler.handleChangeEvent(ResourceManager.java:383)
      2. org.glassfish.javaee.services.ResourceManager$PropertyChangeHandler.changed(ResourceManager.java:328)
      2 frames
    8. HK2 configuration module
      ConfigSupport.sortAndDispatch
      1. org.jvnet.hk2.config.ConfigSupport.sortAndDispatch(ConfigSupport.java:332)
      1 frame
    9. Container Common
      ResourceManager.changed
      1. org.glassfish.javaee.services.ResourceManager.changed(ResourceManager.java:275)
      1 frame
    10. HK2 configuration module
      Transactions$ConfigListenerNotifier$1$1.call
      1. org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:379)
      2. org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:369)
      3. org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:259)
      4. org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:257)
      4 frames
    11. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      5. java.lang.Thread.run(Thread.java:662)
      5 frames