-->
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.  [ 4 posts ] 
Author Message
 Post subject: hbm2java Exception NoClassDefFoundError:.../MappingException
PostPosted: Thu Sep 08, 2005 11:43 am 
Newbie

Joined: Thu Sep 08, 2005 11:37 am
Posts: 8
my built.xml:

Code:
<path id="hibernate.tools.classpath">
   <pathelement path="${basedir}/middlegen-lib/hibernate-tools.jar"/>
   <fileset dir="${basedir}/lib">
      <include name="**/*.jar"/>
   </fileset>
</path>

<target name="hbm2java" description="Generate .java from .hbm files.">
   <taskdef name="hbm2java" classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask" classpathref="hibernate.tools.classpath"/>
   <hbm2java config="${config.dir}/hibernate/hbm2java.xml" output="${basedir}/build/gen-src/airline/hibernate/src">
      <fileset dir="${basedir}/build/gen-src/airline/hibernate">
         <include name="**/*.hbm.xml"/>
      </fileset>
   </hbm2java>
</target>



the error:

Buildfile: build.xml

hbm2java:
[hbm2java] Processing 2 files.
[hbm2java] Building hibernate objects

BUILD FAILED
C:\Documents and Settings\fbianch\Desktop\Middlegen-Hibernate-r4\Middlegen-Hibernate-r4\build.xml:265: Caused by:
Caused by:
java.lang.NoClassDefFoundError: net/sf/hibernate/MappingException
at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:149)
at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)


Total time: 1 second

why ?

thank's in advance

Fabio Bianchi


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 12:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you are missing hibernate.jar with MappingException in it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: OK
PostPosted: Fri Sep 09, 2005 11:21 am 
Newbie

Joined: Thu Sep 08, 2005 11:37 am
Posts: 8
Thanks.

Now all is working fine !!!


Top
 Profile  
 
 Post subject: Due to hbm2java for hibernate 3
PostPosted: Fri Sep 09, 2005 11:41 am 
Newbie

Joined: Thu Sep 08, 2005 11:37 am
Posts: 8
in hibernate2 the class MappingException is located in this package:

\net\sf\hibernate\MappingException

otherwise in hibernate3 the class MappingException is located in this package:

\org\hibernate\MappingException

I due to new version of hbm2java for hibernate 3.

Bye

Fabio


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