-->
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.  [ 12 posts ] 
Author Message
 Post subject: ANT hbm2ddl --> NoClassDefFoundError: org/apache/commons/
PostPosted: Tue Jan 27, 2009 6:29 am 
Newbie

Joined: Sun Jul 27, 2008 10:56 am
Posts: 17
Hibernate: 3.3.1
Hibernate tools: 3.2.4
Eclipse : 3.4
ANT : 1.7

Hi all,
I have a similar problem like that already discussed here
http://forum.hibernate.org/viewtopic.ph ... highlight=

The main difference is that I'm running hbm2ddl from ANT.
Code:
<target name="hbm2ddl" >
    <hibernatetool destdir="${basedir}/generated">
    <classpath>
        <path location="${classes.dir}"/>           
             <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
         </fileset>              
     </classpath>               
       
          <configuration configurationfile="${classes.dir}/hibernate.cfg.xml">
     </configuration>
         
     <hbm2ddl export="false" outputfilename="sql.ddl"/>
    </hibernatetool>         
</target>


When I run that code the console outputs this:
hbm2ddl:
[echo] hbm to ddl starting...
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)

BUILD FAILED
/home/rgambelli/workspace_3_4/StrutsHib/build/build.xml:31: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

Total time: 4 seconds


Inside the classpath element inside hibernatetool task, the variable lib.dir points out to many jars one of which is obviously commons-logging-1.0.4.jar

What could I try?
Thanks and best regards
Gamby


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 5:38 am 
Newbie

Joined: Sun Jul 27, 2008 10:56 am
Posts: 17
At last I've resolved going to eclipse ANT preferences ANT --> Runtime
and inside Global Entries I added a reference to commons-logging-1.0.4.jar

Perhaps documenting this strange issue should be a good thing...

With this solution I was able to execute:
- hbm2ddl
- hbm2java

But trying with task hbm2hbmxml it doesn't work again....now the error is:
java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy

................................... due maroni oh....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 5:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what is in your classpath of the taskdef ?

Remember that is where the classes for the task needs to be,
classpath inside <hibernatetools> is only for your resources; not the hibernate tool task.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 3:42 am 
Newbie

Joined: Sun Jul 27, 2008 10:56 am
Posts: 17
Quote:
what is in your classpath of the taskdef ?


Hi,

I have also tried to put commons-logging-1.0.4.jar inside classpath of taskdef but it didnt' work...

Code:
<path id="toolslib">
       <path location=".........../eclipse/plugins/org.hibernate.eclipse_3.2.4.CR1-R200812191611/lib/tools/hibernate-tools.jar"/>
      <path location="................/eclipse/plugins/org.hibernate.eclipse_3.2.4.CR1-R200812191611/lib/tools/freemarker.jar"/>
      <path location="............./hibernate-distribution-3.3.1.GA/hibernate3.jar"/>
      <path location="............./java_lib/mysql-connector-java-5.0.3-bin.jar"/>
   
      <path location="................/java_lib/dom4j-1.6.1.jar"/>   
      <path location="..................../java_lib/slf4j-1.5.2/slf4j-api-1.5.2.jar"/>
      <path location="................/java_lib/slf4j-1.5.2/slf4j-nop-1.5.2.jar"/>
[b]       <path location="................lib/commons-logging-.0.4.jar"/>[/b]
   </path>      

   <taskdef name="hibernatetool"
            classname="org.hibernate.tool.ant.HibernateToolTask"
            classpathref="toolslib" />


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 9:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i dont see jtidy.jar in there ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 9:54 am 
Newbie

Joined: Sun Jul 27, 2008 10:56 am
Posts: 17
Perhaps you haven't read from beginning this thread...

I said that, speaking about common-logging, and running hbm2ddl, task which doesn't need org/w3c/tidy/Tidy, I've tried to include common-logging in the classpath of taskdef but it didn't work...

hbm2hbmxml needs also org/w3c/tidy/Tidy....


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 9:54 am 
Newbie

Joined: Sun Jul 27, 2008 10:56 am
Posts: 17
Perhaps you haven't read from beginning this thread...

I said that, speaking about common-logging, and running hbm2ddl, task which doesn't need org/w3c/tidy/Tidy, I've tried to include common-logging in the classpath of taskdef but it didn't work...

hbm2hbmxml needs also org/w3c/tidy/Tidy....


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2009 5:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
sorry, missed that.

But I don't get this when I run it from the commandline...

are you running it only through eclipse or is it also failing on commandline for you ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2009 5:12 am 
Newbie

Joined: Sun Jul 27, 2008 10:56 am
Posts: 17
Quote:
are you running it only through eclipse or is it also failing on commandline for you ?


I'm running ANT inside Eclipse.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 31, 2009 4:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and if you run outside of eclipse ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: The same problem
PostPosted: Sun Feb 08, 2009 10:46 am 
Newbie

Joined: Sun Feb 08, 2009 10:41 am
Posts: 13
Hi, I'm new in Hibernate, and learn from Hibernate in Action. And also, I do not any more where to store hibernate-tools.jar and what to do, because whatever I do I get the same exception when I try to execute schemaexport.
So, what is the problem? Is it so "book" bug, just to spent a day-two, in resolving some technical problems or what? So does anyone have the same problem and get an explanation. If any, please share with me, until I explode :-))
Thanks...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2009 9:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Please show me which example in hibernate in action that fails to run ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.