Hello I try the tutorial of hibernate tool
this is my ant code
Code:
<path id="toolslib">
<path location="lib/hibernate-tools.jar" />
<path location="lib/hibernate3.jar" />
<path location="lib/freemarker.jar" />
<path location="${jdbc.driver.jar}" />
</path>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />
<target name="hibernatetool">
<hibernatetool destdir="${build.dir}/generated">
<classpath>
<path location="${build.dir}/classesTest" />
</classpath>
<configuration configurationfile="hibernate.cfg.xml" />
<hbm2java />
</hibernatetool>
</target>
my classpath
Code:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/antlr-2.7.6.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="lib/javassist-3.4.GA.jar"/>
<classpathentry kind="lib" path="lib/jta-1.1.jar"/>
<classpathentry kind="lib" path="lib/hibernate3.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.5.6.jar"/>
<classpathentry kind="lib" path="lib/CallServicesJW.jar"/>
<classpathentry kind="lib" path="lib/ctgclient.jar"/>
<classpathentry kind="lib" path="lib/fda7.jar"/>
<classpathentry kind="lib" path="lib/ojdbc14.jar"/>
<classpathentry kind="lib" path="lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="lib/commons-beanutils-1.8.0.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.4.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/slf4j-log4j12-1.5.6.jar"/>
<classpathentry kind="lib" path="lib/iText-2.1.5.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
<classpathentry kind="lib" path="lib/dozer-5.1.jar"/>
<classpathentry kind="lib" path="lib/hibernate-tools.jar"/>
<classpathentry kind="lib" path="lib/dbunit-2.4.6.jar"/>
<classpathentry kind="lib" path="lib/freemarker.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>
and my console with this error
Quote:
BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.hibernate.tool.hbm2x.AbstractExporter.<init>(AbstractExporter.jav
a:25)
at org.hibernate.tool.hbm2x.GenericExporter.<init>(GenericExporter.java:
77)
at org.hibernate.tool.hbm2x.POJOExporter.<init>(POJOExporter.java:28)
at org.hibernate.tool.ant.Hbm2JavaExporterTask.createExporter(Hbm2JavaEx
porterTask.java:41)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:186)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
I don t anderstand
I have hibernate-tools.jar in my classpath
can someone help me please