Hello, sorry for my english and sorry for repeat subject but the others topics with this subject didn't resolve my problem.
My example es very easy, i have a Dynamic web project with a 3 files: persistence.xml, hibernate.revenge.xml and build.xml.
I want to generate entitys and dao's with jpa annotations from a data base (Oracle10g).
build.xml:
<project name="MyProject" default="hbm2java" basedir=".">
<path id="lib.class.path">
<fileset dir="C:\Alvaro\Software\OtherLib">
<include name="*.jar" />
</fileset>
<fileset dir="C:\Alvaro\Software\JAR's">
<include name="*.jar"/>
</fileset>
</path>
<target name="hbm2java">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="lib.class.path" />
<hibernatetool destdir="src">
<!-- JPA configuration -->
<jpaconfiguration persistenceunit="PruebaAntPersistence" />
<!--<jdbcconfiguration packagename="" configurationfile="hibernate.cfg.xml" revengfile="../WebContent/WEB-INF/hibernate.reveng.xml" ></jdbcconfiguration> -->
<hbm2java destdir="" templatepath="/templates" jdk5="true" ejb3="true" />
<hbm2dao destdir="" jdk5="true" ejb3="true" />
<classpath>
<path location="${build.dir}/target/classes" />
</classpath>
</hibernatetool>
</target>
</project>
If i uncommented line "<jdbcconfiguration....." ( with hibernate.cfg.xml instead of persistence.xml) and commented <jpaconfiguration... runs rightpersistence.xml:
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd">
<persistence-unit name="PruebaAntPersistence" >
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.connection.password" value="XXX" />
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@XX.XX.XX.XX:XXXX:orcl28" />
<property name="hibernate.connection.username" value="XXX" />
<property name="hibernate.default_schema" value="XXX" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
</properties>
</persistence-unit>
</persistence>
I put the file persistence.xml in all sites (/, /src, /src/META-INF, ........) of my project, and it is in Project\build\classes\META-INF
I don't understand why doesn't it run.
Thanks and sorry for my english again.