Hi,
I'm trying to use the EnversHibernateToolTask plugin, but I'm always getting the following error message: "
Problems in creating a configuration for JPA. Have you remembered to add hibernate EntityManager jars to the classpath". I'm pretty sure that the Hibernate EntityManager jars are included in the classpath.
Could someone please help me with this issue ?
Regards, Stefan Lecho.
Code:
<project default="schemaexport">
<target name="schemaexport"
description="Exports a generated schema to DB and file">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.EnversHibernateToolTask"
classpath=".;c:\Users\manager\.m2\repository\org\jboss\envers\jboss-envers\1.2.3-hibernate-3.3\jboss-envers-1.2.3-hibernate-3.3.jar;c:\Users\manager\.m2\repository\org\hibernate\hibernate-tools\3.2.3.GA\hibernate-tools-3.2.3.GA.jar;c:\Users\manager\.m2\repository\org\hibernate\hibernate\3.2.6.ga\hibernate-3.2.3.ga.jar;c:\Users\manager\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;c:\Users\manager\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;c:\Users\manager\.m2\repository\org\hibernate\hibernate-core\3.3.2.GA\hibernate-core-3.3.2.GA.jar;c:\Users\manager\.m2\repository\org\slf4j\slf4j-api\1.5.8\slf4j-api-1.5.8.jar;c:\Users\manager\.m2\repository\org\slf4j\slf4j-log4j12\1.5.6\slf4j-log4j12-1.5.6.jar;c:\Users\manager\.m2\repository\log4j\log4j\1.2.13\log4j-1.2.13.jar" />
<!--classpathref="${schema.classpath}"/>-->
<hibernatetool destdir=".">
<classpath>
<!--fileset refid="lib.hibernate" /-->
<!--path location="${build.dir}" /-->
<fileset dir="c:/Users/manager/.m2/repository">
<include name="**/*.jar"/>
</fileset>
</classpath>
<jpaconfiguration persistenceunit="btwentiteit"/>
<hbm2ddl
drop="false"
create="true"
export="false"
outputfilename="versioning-ddl.sql"
delimiter=";"
format="true"/>
</hibernatetool>
</target>
</project>
Code:
c:\projects\FODFin\STIRON\L2-M1\BTWEntiteit\trunk\BTWEntiteit>ant
Buildfile: c:\projects\FODFin\STIRON\L2-M1\BTWEntiteit\trunk\BTWEntiteit\build.xml
schemaexport:
[hibernatetool] Executing Hibernate Tool with a JPA 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 configuration for JPA. Have you remembered to add hibernate EntityManager jars to the classpath ?
[hibernatetool] java.lang.reflect.InvocationTargetException
[hibernatetool] java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Mappings.<init>(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Lj
ava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/
Map;Ljava/util/Map;Ljava/util/List;Ljava/util/Map;Ljava/util/Map;)V from class org.hibernate.cfg.ExtendedMappings
BUILD FAILED
c:\projects\FODFin\STIRON\L2-M1\BTWEntiteit\trunk\BTWEntiteit\build.xml:8: Problems in creating a configuration for JPA. Have you remembered to add hi
bernate EntityManager jars to the classpath ?
Total time: 2 seconds