aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Classpath problems(?) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Classpath problems(?)" Watch "Classpath problems(?)" New topic
Author

Classpath problems(?)

Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178
First some code:


This is my build.xml. Sorry for posting all of it, but I want to make sure that nothing is missing. This build.xml belongs to a project I set up in Eclipse 3.2.1 to learn Hibernate (+ Hibernate tools). Everytime I try to run "codegen" I get:

Buildfile: C:\Java\Eigene Projekte\Hibernate\build.xml
codegen:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)

BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

Total time: 1 second

This happens when starting from Eclipse and externally with a local Ant install. All external libraries reside in a lib folder next to the build.xml. commons-logging-1.0.4.jar IS in lib, it seems like it is not included in the classpath, but I think <path id="project.class.path"> etc... is correct.

What am I missing here? Is there a way to see the classpath Ant is using?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

I think it's <echo message="classpath = ${class.path}"/>. In other words, Ant's a Java program and it passes on the JVM properties from the java.lang.System class.


Customer surveys are for companies who didn't pay proper attention to begin with.
jj huang
Greenhorn

Joined: Mar 02, 2007
Posts: 1
you are just missing some jar files in "toolslib" , look at below, you won't miss it!

<path id="toolslib">
<path location="lib/hibernate-tools.jar"/>
<path location="lib/hibernate3.jar"/>
<path location="lib/freemarker.jar" />
....... add your jar here ............... like commons-logging-xx.jar
</path>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classpath problems(?)
 
Similar Threads
Problem using Hibernate Extensions: hbm2java
Schema text failed: Dialect class not found
problem at using hibernate extension to build *java from *.hbm.xml
Trouble understanding Ant('s classpath)
Hibernate with HSQLdb - SQLException requires collation in statement