-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problems trying to use hibernate-tools with ant.
PostPosted: Sun Feb 22, 2009 4:37 pm 
Newbie

Joined: Sun Feb 22, 2009 4:25 pm
Posts: 3
Hi,

I'm having a problem trying to use ant's codegen. This is the stack trace:

Quote:
>ant codegen
Buildfile: build.xml

prepare:

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
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:597)
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)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFacto
ry
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 23 more

Total time: 1 second


I'm pretty sure I've added all the necesary JAR files to ant's lib folder (hibernate3, hibernate-tools, maven-ant-tasks, etc.), I know the problem is related to a non existent library or something, though.

What am I doing wrong ?

PD: sorry about bad english.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 22, 2009 6:45 pm 
Regular
Regular

Joined: Sat Nov 06, 2004 5:20 pm
Posts: 54
Location: Collierville, TN
You need to download commons-logging.jar and place is in your classpath - not necessarily the ant lib directory.

Get the jar here: http://commons.apache.org/logging/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.