title: Hibernate Tools: Error parsing JNDI name
body: <p>We are trying to upgrade from Hibernate 3.6.7 to 4.1.2 and Hibernate Tools 3.2.0 to 3.5.0</p>
  
  <p>We generate a DB creation script using Ant:</p>
  
  <pre><code>     &lt;hibernatetool destdir="${target}"&gt;
          &lt;jpaconfiguration persistenceunit="stdcmpOrderPersistenceUnit" propertyfile="@{propertyfile}"/&gt;
          &lt;classpath refid="@{classpathid}"/&gt;
          &lt;!-- the file name is relative to $destdir --&gt;
          &lt;hbm2ddl outputfilename="@{output}" format="true" export="false" drop="false"/&gt;
       &lt;/hibernatetool&gt;
  </code></pre>
  
  <p>Our persistence unit look like this:</p>
  
  <pre><code>&lt;persistence-unit name="stdcmpOrderPersistenceUnit" transaction-type="JTA"&gt;
  
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;jta-data-source&gt;jdbc/lakshmi_stdcmp&lt;/jta-data-source&gt;
      &lt;mapping-file&gt;META-INF/stdcmpOrderNamedQueries.xml&lt;/mapping-file&gt;
  
      &lt;class&gt;ch.ethz.id.wai.lakshmi.stdcmp.persistency.PersistentOrder&lt;/class&gt;
  
      &lt;exclude-unlisted-classes&gt;true&lt;/exclude-unlisted-classes&gt;
  
      &lt;properties&gt;
          &lt;property name="hibernate.show_sql" value="false"/&gt;
          &lt;property name="hibernate.format_sql" value="false"/&gt;
      &lt;/properties&gt;
  
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>After the upgrade we get the following error:</p>
  
  <pre><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
  </code></pre>
  
  <p>Why does Hibernate try to resolve the JNDI name since all the information on the PersistenceUnit is available?
  We had no problems with the old version.</p>
  
  <p>And in any case how can we specify a NamingFactory? (and which one?)</p>