org.hibernate.service.jndi.JndiException: Error performing unbind [java:/jboss/com.domain.jpa]

Hibernate JIRA | Darryl Miles | 4 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    If when The persistence Unit is started the JNDI binding failed, then either 1) It should not attempt to unbind() at all during shutdown. Maybe it will unbind() somebody elses instance by mistake, not the instance it things it owns? 2) If it must attempt to unbind() anyway, it should more silently emit a log message, indicating failure but also that bind() never completed during startup. At the moment it throws an exception noisily for a condition that is expected in the situation. But no such exception is thrown during startup, even through that is a more major concern. That expected configuration option requested could not be enforced during startup. So it seems a bit backwards, you'd expect a startup failure Exception and a quietness on shutdown. Since it was shutting down anyway! During Deploy. 09:03:12,802 DEBUG [org.hibernate.service.jndi.internal.JndiServiceImpl] (ServerService Thread Pool -- 69) Bound name: java:/jboss/com.domain.jpa 09:03:12,802 INFO [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 69) HHH000094: Bound factory to JNDI name: java:/jboss/com.domain.jpa 09:03:12,803 DEBUG [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 69) HHH000127: Could not bind JNDI listener During Undeploy: 09:04:22,974 WARN [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 70) HHH000374: Could not unbind factory from JNDI: org.hibernate.service.jndi.JndiException: Error performing unbind [java:/jboss/com.domain.jpa] at org.hibernate.service.jndi.internal.JndiServiceImpl.unbind(JndiServiceImpl.java:181) at org.hibernate.internal.SessionFactoryRegistry.removeSessionFactory(SessionFactoryRegistry.java:117) at org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1389) at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:194) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2.run(PersistenceUnitServiceImpl.java:124) [jboss-as-jpa-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17] at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final.jar:2.1.0.Final] Caused by: javax.naming.NamingException: JBAS011836: Could not resolve service service jboss.naming.context.java.jboss."com.domain.jpa" at org.jboss.as.naming.WritableServiceBasedNamingStore.unbind(WritableServiceBasedNamingStore.java:121) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at org.jboss.as.naming.WritableServiceBasedNamingStore.unbind(WritableServiceBasedNamingStore.java:112) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at org.jboss.as.naming.NamingContext.unbind(NamingContext.java:286) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at org.jboss.as.naming.InitialContext.unbind(InitialContext.java:165) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at javax.naming.InitialContext.unbind(InitialContext.java:439) [rt.jar:1.7.0_17] at org.hibernate.service.jndi.internal.JndiServiceImpl.unbind(JndiServiceImpl.java:178) ... 8 more

    Hibernate JIRA | 4 years ago | Darryl Miles
    org.hibernate.service.jndi.JndiException: Error performing unbind [java:/jboss/com.domain.jpa]
  2. 0

    If when The persistence Unit is started the JNDI binding failed, then either 1) It should not attempt to unbind() at all during shutdown. Maybe it will unbind() somebody elses instance by mistake, not the instance it things it owns? 2) If it must attempt to unbind() anyway, it should more silently emit a log message, indicating failure but also that bind() never completed during startup. At the moment it throws an exception noisily for a condition that is expected in the situation. But no such exception is thrown during startup, even through that is a more major concern. That expected configuration option requested could not be enforced during startup. So it seems a bit backwards, you'd expect a startup failure Exception and a quietness on shutdown. Since it was shutting down anyway! During Deploy. 09:03:12,802 DEBUG [org.hibernate.service.jndi.internal.JndiServiceImpl] (ServerService Thread Pool -- 69) Bound name: java:/jboss/com.domain.jpa 09:03:12,802 INFO [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 69) HHH000094: Bound factory to JNDI name: java:/jboss/com.domain.jpa 09:03:12,803 DEBUG [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 69) HHH000127: Could not bind JNDI listener During Undeploy: 09:04:22,974 WARN [org.hibernate.internal.SessionFactoryRegistry] (ServerService Thread Pool -- 70) HHH000374: Could not unbind factory from JNDI: org.hibernate.service.jndi.JndiException: Error performing unbind [java:/jboss/com.domain.jpa] at org.hibernate.service.jndi.internal.JndiServiceImpl.unbind(JndiServiceImpl.java:181) at org.hibernate.internal.SessionFactoryRegistry.removeSessionFactory(SessionFactoryRegistry.java:117) at org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1389) at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:194) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2.run(PersistenceUnitServiceImpl.java:124) [jboss-as-jpa-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17] at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final.jar:2.1.0.Final] Caused by: javax.naming.NamingException: JBAS011836: Could not resolve service service jboss.naming.context.java.jboss."com.domain.jpa" at org.jboss.as.naming.WritableServiceBasedNamingStore.unbind(WritableServiceBasedNamingStore.java:121) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at org.jboss.as.naming.WritableServiceBasedNamingStore.unbind(WritableServiceBasedNamingStore.java:112) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at org.jboss.as.naming.NamingContext.unbind(NamingContext.java:286) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at org.jboss.as.naming.InitialContext.unbind(InitialContext.java:165) [jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4] at javax.naming.InitialContext.unbind(InitialContext.java:439) [rt.jar:1.7.0_17] at org.hibernate.service.jndi.internal.JndiServiceImpl.unbind(JndiServiceImpl.java:178) ... 8 more

    Hibernate JIRA | 4 years ago | Darryl Miles
    org.hibernate.service.jndi.JndiException: Error performing unbind [java:/jboss/com.domain.jpa]

    Root Cause Analysis

    1. javax.naming.NamingException

      JBAS011836: Could not resolve service service jboss.naming.context.java.jboss."com.domain.jpa"

      at org.jboss.as.naming.WritableServiceBasedNamingStore.unbind()
    2. JBoss Application Server: Naming Subsystem
      InitialContext.unbind
      1. org.jboss.as.naming.WritableServiceBasedNamingStore.unbind(WritableServiceBasedNamingStore.java:121)[jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
      2. org.jboss.as.naming.WritableServiceBasedNamingStore.unbind(WritableServiceBasedNamingStore.java:112)[jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
      3. org.jboss.as.naming.NamingContext.unbind(NamingContext.java:286)[jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
      4. org.jboss.as.naming.InitialContext.unbind(InitialContext.java:165)[jboss-as-naming-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
      4 frames
    3. Java RT
      InitialContext.unbind
      1. javax.naming.InitialContext.unbind(InitialContext.java:439)[rt.jar:1.7.0_17]
      1 frame
    4. Hibernate
      SessionFactoryImpl.close
      1. org.hibernate.service.jndi.internal.JndiServiceImpl.unbind(JndiServiceImpl.java:178)
      2. org.hibernate.internal.SessionFactoryRegistry.removeSessionFactory(SessionFactoryRegistry.java:117)
      3. org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1389)
      3 frames
    5. Hibernate EJB
      EntityManagerFactoryImpl.close
      1. org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:194)
      1 frame
    6. JPA
      PersistenceUnitServiceImpl$2.run
      1. org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2.run(PersistenceUnitServiceImpl.java:124)[jboss-as-jpa-7.2.0.Alpha1-redhat-4.jar:7.2.0.Alpha1-redhat-4]
      1 frame
    7. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.0_17]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[rt.jar:1.7.0_17]
      3. java.lang.Thread.run(Thread.java:722)[rt.jar:1.7.0_17]
      3 frames
    8. JBoss Threads
      JBossThread.run
      1. org.jboss.threads.JBossThread.run(JBossThread.java:122)[jboss-threads-2.1.0.Final.jar:2.1.0.Final]
      1 frame