I have a trouble upgrading to Hibernate 4.3.x from 4.2.7. I got this exception:
Code:
Caused by: javax.naming.NameNotFoundException: Name [java:comp/env/jdbc/data] is not bound in this Context. Unable to find [java:comp].
at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
at javax.naming.InitialContext.lookup(InitialContext.java:415)
at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114)
... 82 more
I'm using Tomcat 7.0.29 (tried 7.0.47 as well) and JDK 7 (v25). There is no problem with Hibernate 4.2.7.
Here is my persistence.xml:
Code:
<persistence-unit name="data" transaction-type="RESOURCE_LOCAL">
<non-jta-data-source>java:comp/env/jdbc/data</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>
But I don't think the problem is here. I did a little bit of debug research and found out the following:
Code:
JndiServiceImpl#locate(String jndiName)
creates an initial context which differs.
4.3.0 - org.apache.naming.NamingContext
4.2.7 - org.apache.naming.SelectorContext
Except for this, I couldn't find any more differences.
Thanks for any help.