Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Error parsing JNDI name
PostPosted: Fri May 11, 2012 9:28 am 
Newbie

Joined: Sun Dec 25, 2011 4:31 am
Posts: 2
Location: Bern, Switzerland
We are trying to upgrade from Hibernate 3.6.7 to 4.1.2 and Hibernate Tools 3.2.0 to 3.5.0

We generate a DB creation script using Ant:

Code:
         <hibernatetool destdir="${target}">
            <jpaconfiguration persistenceunit="stdcmpOrderPersistenceUnit" propertyfile="@{propertyfile}"/>
            <classpath refid="@{classpathid}"/>
            <!-- the file name is relative to $destdir -->
            <hbm2ddl outputfilename="@{output}" format="true" export="false" drop="false"/>
         </hibernatetool>


Our persistence unit look like this:

Code:
    <persistence-unit name="stdcmpOrderPersistenceUnit" transaction-type="JTA">

        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/lakshmi_stdcmp</jta-data-source>
        <mapping-file>META-INF/stdcmpOrderNamedQueries.xml</mapping-file>

        <class>ch.ethz.id.wai.lakshmi.stdcmp.persistency.PersistentOrder</class>

        <exclude-unlisted-classes>true</exclude-unlisted-classes>

        <properties>
            <property name="hibernate.show_sql" value="false"/>
            <property name="hibernate.format_sql" value="false"/>
        </properties>

    </persistence-unit>


After the upgrade we get the following error:

Code:
[hibernatetool] org.hibernate.service.jndi.JndiException: Error parsing JNDI name [jdbc/lakshmi_stdcmp]
[hibernatetool] javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial


Why does Hibernate try to resolve the JNDI name since all the information on the PersistenceUnit is available? And in any case how can we specify a NamingFactory? (and which one?)

Many thanks

Matteo


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.