Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

Classpath problems(?)

Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)

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?
Saloon Keeper
Posts: 21612
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Hot dog! An advertiser loves us THIS much:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!