Hi there, I am totally new to hibernate tools. Don't even know how to configure properly. I am facing the following exception. Need help. Urgent. Following is build.xml target and path description and then followed by command console with exception output.
<path id="toolslib"> <path location="lib/hibernate/hibernate-tools-4.0.0.jar" /> <path location="lib/hibernate/hibernate3.jar" /> <path location="lib/hibernate/freemarker.jar" /> <path location="lib/hibernate/slf4j-api-1.5.8.jar" /> <path location="lib/hibernate/commons-logging-api-1.0.4.jar" /> <path location="lib/hibernate/slf4j-log4j12-1.5.8.jar" /> <path location="lib/hibernate/log4j-1.2.15.jar" /> <path location="lib/hibernate/hibernate-core-4.0.0.CR6.jar" /> <path location="lib/hibernate/log4j-1.2.15.jar" /> <path location="lib/hibernate/hibernate-jpa-2.0-api-1.0.1.Final.jar" /> <path location="lib/hibernate/bsh-2.0b1.jar" /> </path> <target name="hibernatetool" description="Generate Hibernate POJO"> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" /> <hibernatetool destdir="src/main/generated"> <configuration configurationfile="src/main/hibernate/hibernate.cfg.xml" propertyfile="src/main/database.properties"> <fileset dir="src/main"> <include name="**/*.hbm.xml"/> </fileset> </configuration> <hbm2java jdk5="true"/> <hbm2java ejb3="true"/> </hibernatetool> </target>
D:\NIMS\Nims_Trunk>ant hibernatetool Buildfile: build.xml
hibernatetool: [hibernatetool] Executing Hibernate Tool with a Standard Configuration [hibernatetool] 1. task: hbm2java (Generates a set of .java files) [hibernatetool] SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version [hibernatetool] Sep 6, 2012 12:52:20 PM org.hibernate.cfg.Environment <clinit> [hibernatetool] INFO: Hibernate 3.1.1 [hibernatetool] Sep 6, 2012 12:52:20 PM org.hibernate.cfg.Environment <clinit> [hibernatetool] INFO: hibernate.properties not found [hibernatetool] Sep 6, 2012 12:52:20 PM org.hibernate.cfg.Environment <clinit> [hibernatetool] INFO: using CGLIB reflection optimizer [hibernatetool] Sep 6, 2012 12:52:20 PM org.hibernate.cfg.Environment <clinit> [hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling [hibernatetool] Sep 6, 2012 12:52:20 PM org.hibernate.cfg.Configuration configure [hibernatetool] INFO: configuring from file: hibernate.cfg.xml [hibernatetool] Sep 6, 2012 12:52:21 PM org.hibernate.cfg.Configuration doConfigure [hibernatetool] INFO: Configured SessionFactory: null [hibernatetool] Sep 6, 2012 12:52:21 PM org.hibernate.cfg.Configuration addFile [hibernatetool] INFO: Reading mappings from file: D:\NIMS\Nims_Trunk\src\main\KPIYearMaster.hbm.xml [hibernatetool] Sep 6, 2012 12:52:21 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues [hibernatetool] INFO: Mapping class: com.nihilent.hrms.model.KPIYearMaster -> kpi_YearMaster [hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.tool.hbm2x.POJOExporter). [hibernatetool] log4j:WARN Please initialize the log4j system properly. [hibernatetool] An exception occurred while running exporter #2:hbm2java (Generates a set of .java files) [hibernatetool] To get the full stack trace run ant with -verbose [hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing Entity: com.nihilent.hrms.model.KPIYearMaster with template pojo/Po jo.ftl [hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getJavaTypeNam e(org.hibernate.mapping.Property,boolean) threw an exception when invoked on Entity: com.nihilent.hrms.model.KPIYearMaster [hibernatetool] java.lang.reflect.InvocationTargetException [hibernatetool] java.lang.VerifyError: (class: org/hibernate/type/BasicTypeRegistry, method: <init> signature: ()V) Incompatible argument to function
BUILD FAILED D:\NIMS\Nims_Trunk\build.xml:32: org.hibernate.tool.hbm2x.ExporterException: Error while processing Entity: com.nihilent.hrms.model.KPIYearMaster with template pojo/Pojo.ftl
Total time: 2 seconds D:\NIMS\Nims_Trunk>
|