-->
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: net.sf.hibernate.MappingException
PostPosted: Mon Mar 01, 2004 2:08 pm 
Newbie

Joined: Mon Mar 01, 2004 2:01 pm
Posts: 1
HI,

I get the following error:

hibernate Could not compile the mapping document java.lang.ClassNotFoundException:

net.sf.hibernate.MappingException: persistent class not found:

Hibernate version: version 2.0.3, 27 August 2003
Name and version of database: mysql:

Thanks for the help!

Mapping document:
books.hbm.xml
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class
name="com.model.books"
table="users"
dynamic-update="false"
dynamic-insert="false"
>

<id
name="id"
column="id"
type="long"
unsaved-value="-1"
>
<generator class="native">
</generator>
</id>

<property
name="username"
type="java.lang.String"
update="true"
insert="true"
column="username"
not-null="true"
unique="true"
/>

<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
/>

<property
name="password"
type="java.lang.String"
update="true"
insert="true"
column="password"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Users.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>


Stack Trace is as follows:
[java] java.lang.ClassNotFoundException: com..model.Books
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:140)
[java] at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:263)
[java] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:71)
[java] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:163)
[java] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076)
[java] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
[java] at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
[java] at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:318)
[java] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:282)
[java] rethrown as
[java] net.sf.hibernate.MappingException: persistent class not found: com.model.Books
[java] at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:74)
[java] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:163)
[java] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076)
[java] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
[java] at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
[java] at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:318)
[java] at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:282)
[java] Caused by: java.lang.ClassNotFoundException: com.model.Books
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
[java] Error creating schema persistent class not found: com.dynetics.vidrds.model.Books
[java] java.lang.ClassNotFoundException: com.model.Users
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 2:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well as far as I can deduce from your post, you are refering to a class called com.model.Books in your mappings which is not on your classpath. Check your classpath ...


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.