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)
|