Hibernate version:3.2.0.cr3, checked out and built from svn this morning
Hi folks. I'm having a classpath problem running the example. I've tried every trick I know to get it work, and the debug output from ant seems to indicate all is well...
Working with the example tutorial, when I try to run it, I get:
Code:
[tunaranch:~/Documents/eclipse_sandbox/hibernate-tute] haikal% ant run -Daction=store
Buildfile: build.xml
copy-resources:
[copy] Copying 3 files to /Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin
[copy] Copied 2 empty directories to 1 empty directory under /Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin
compile:
[javac] Compiling 3 source files to /Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin
copy-deps:
[copy] Copying 11 files to /Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib
run:
[echo] Ant Version: Apache Ant version 1.6.2 compiled on May 14 2005
[echo] Classpath: /Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/hibernate3.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/ant-antlr-1.6.5.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/asm-attrs.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/asm.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/cglib-2.1.3.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/commons-collections-2.1.1.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/commons-logging-1.0.4.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/dom4j-1.6.1.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/hsqldb.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/jta.jar:/Users/haikal/Documents/eclipse_sandbox/hibernate-tute/bin/lib/lib/log4j-1.2.11.jar
[java] Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/dom4j/DocumentException
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
[java] ... 3 more
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 8 seconds
The dom4j jar is definitely in the classpath, and extracting the jar shows that it's okay. I've tried a few different versions of dom4j, but nothing worked.
Here's an excerpt from the ant script:
Code:
<target name="copy-deps">
<copy todir="${targetdir}/lib">
<fileset dir="${librarydir}" />
</copy>
</target>
<path id="runtime-classpath">
<pathelement path="${targetdir}" />
<fileset dir="${targetdir}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="run" depends="compile, copy-deps">
<echo>Ant Version: ${ant.version}</echo>
<echo>Classpath: ${toString:runtime-classpath}</echo>
<java fork="true" classname="events.EventManager" classpathref="runtime-classpath">
<arg value="${action}" />
</java>
</target>
Sorry for posting such a basic question, but it looks like it should all just work... I've exhausted my bag of tricks, the dom4j jar is in the classpath... I've tried about two different tutorials, and both end up with the same outcome. I'm stumped.