I have a similar problem. So far, I've reached the point that hbm2dll seems to read my classes, but then stops with:
Code:
[hibernatetool] Executing Hibernate Tool with a EJB3 Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generates database schema)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] Problems in creating a Ejb3Configuration. Have you remembered to add it to the classpath ?
[hibernatetool] java.lang.reflect.InvocationTargetException
[hibernatetool] javax.persistence.PersistenceException: No name provided and several persistence units found
BUILD FAILED
build.xml:89: Problems in creating a Ejb3Configuration. Have you remembered to add it to the classpath ?
My build.xml reads:
Code:
<hibernatetool destdir="${build.dir}">
<ejb3configuration />
<classpath>
<!-- it is in this classpath you put your classes dir,
and/or ejb3 persistence compliant jar -->
<path location="${build.prod.dir}" />
</classpath>
<!-- list exporters here -->
<hbm2ddl export="false" drop="true" create="true"
outputfilename="schema-export.sql" delimiter=";" format="true" />
</hibernatetool>
While my persistence.xml reads:
Code:
<persistence-unit name="regintel" transaction-type="RESOURCE_LOCAL">
<class>com.vst.model.Parametri</class>
<class>com.vst.model.Dato</class>
<class>com.vst.model.Localita</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.OracleDialect" />
<property name="hibernate.connection.driver_class"
value="oracle.jdbc.OracleDriver" />
<property name="hibernate.connection.username" value="interel232" />
<property name="hibernate.connection.password" value="pword" />
<property name="hibernate.connection.url"
value="jdbc:oracle:thin:@localhost:1521:orcl" />
<property name="hibernate.max_fetch_depth" value="3" />
</properties>
</persistence-unit>
The error seems to hint that the name of the persistence unit needs to be specified, but it's not clear to me where...
Thanks in advance,
Michele