-->
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: Hbm2java+Hibernate3: org.hibernate.MappingException
PostPosted: Mon May 02, 2005 3:38 pm 
Newbie

Joined: Mon May 02, 2005 3:31 pm
Posts: 4
Hibernate version: 3

Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
   <class name="com.meller.stones.models.User">
      <id name="id">
         <generator class="native"/>
      </id>
      <property name="login" column="u_login_name" type="string" not-null="true" unique="true"/>
      
      <property name="password" column="u_password" type="string"
         not-null="true">
      </property>
      <property name="voornaam" column="u_voornaam" type="string"
         not-null="true">
      </property>
      <property name="achternaam" column="u_achternaam"
         not-null="true" type="string">
      </property>
      <property name="adres" column="u_adres" type="string"
         not-null="true">
      </property>
      <property name="postcode" column="u_postcode" type="string"
         not-null="true">
      </property>
      <property name="woonplaats" column="u_woonplaats"
         not-null="true" type="string">
      </property>
      <property name="telefoon" column="u_telefoon" type="string"
         not-null="true">
      </property>
      <property name="mobiel" column="u_mobiel" type="string">
      </property>
      <property name="email" column="u_email" type="string"
         not-null="true">
      </property>
      <property name="created" column="u_created" type="timestamp"
         not-null="true">
      </property>
      <property name="activated" column="u_activated"
         type="boolean">
      </property>
      <property name="last_login" column="u_last_login"
         type="timestamp">
      </property>
   </class>

</hibernate-mapping>


Full stack trace of any exception that occurs:
Code:
[hbm2java] org.hibernate.MappingException: class com.meller.stones.models.User not found while looking for property: id
[hbm2java]    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
[hbm2java]    at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
[hbm2java]    at org.hibernate.cfg.Configuration.add(Configuration.java:360)
[hbm2java]    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:397)
[hbm2java]    at org.hibernate.cfg.Configuration.addFile(Configuration.java:243)
[hbm2java]    at org.hibernate.tool.hbm2java.CodeGenerator.parseFiles(CodeGenerator.java:110)
[hbm2java]    at org.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:95)
[hbm2java]    at org.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]    at org.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hbm2java]    at org.apache.tools.ant.Task.perform(Task.java:364)
[hbm2java]    at org.apache.tools.ant.Target.execute(Target.java:341)
[hbm2java]    at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hbm2java]    at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[hbm2java]    at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[hbm2java]    at org.apache.tools.ant.Main.runBuild(Main.java:673)
[hbm2java]    at org.apache.tools.ant.Main.startAnt(Main.java:188)
[hbm2java]    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[hbm2java]    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
[hbm2java] Caused by: java.lang.ClassNotFoundException: com.meller.stones.models.User
[hbm2java]    at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1149)
[hbm2java]    at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
[hbm2java]    at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
[hbm2java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[hbm2java]    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[hbm2java]    at java.lang.Class.forName0(Native Method)
[hbm2java]    at java.lang.Class.forName(Class.java:141)
[hbm2java]    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
[hbm2java]    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
[hbm2java]    ... 22 more
[hbm2java] 21:28:26,712 ERROR Configuration:246 - Could not configure datastore from file: C:\Programming\j2ee-workspace\Stones\WebRoot\WEB-INF\classes\com\meller\stones\models\User.hbm.xml
[hbm2java] org.hibernate.MappingException: class com.meller.stones.models.User not found while looking for property: id
[hbm2java]    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
[hbm2java]    at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
[hbm2java]    at org.hibernate.cfg.Configuration.add(Configuration.java:360)
[hbm2java]    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:397)
[hbm2java]    at org.hibernate.cfg.Configuration.addFile(Configuration.java:243)
[hbm2java]    at org.hibernate.tool.hbm2java.CodeGenerator.parseFiles(CodeGenerator.java:110)
[hbm2java]    at org.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:95)
[hbm2java]    at org.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]    at org.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hbm2java]    at org.apache.tools.ant.Task.perform(Task.java:364)
[hbm2java]    at org.apache.tools.ant.Target.execute(Target.java:341)
[hbm2java]    at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hbm2java]    at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[hbm2java]    at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[hbm2java]    at org.apache.tools.ant.Main.runBuild(Main.java:673)
[hbm2java]    at org.apache.tools.ant.Main.startAnt(Main.java:188)
[hbm2java]    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[hbm2java]    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
[hbm2java] Caused by: java.lang.ClassNotFoundException: com.meller.stones.models.User
[hbm2java]    at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1149)
[hbm2java]    at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
[hbm2java]    at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
[hbm2java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[hbm2java]    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[hbm2java]    at java.lang.Class.forName0(Native Method)
[hbm2java]    at java.lang.Class.forName(Class.java:141)
[hbm2java]    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
[hbm2java]    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
[hbm2java]    ... 22 more
[hbm2java] org.hibernate.MappingException: Could not configure datastore from file: C:\Programming\j2ee-workspace\Stones\WebRoot\WEB-INF\classes\com\meller\stones\models\User.hbm.xml
[hbm2java]    at org.hibernate.cfg.Configuration.addFile(Configuration.java:247)
[hbm2java]    at org.hibernate.tool.hbm2java.CodeGenerator.parseFiles(CodeGenerator.java:110)
[hbm2java]    at org.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:95)
[hbm2java]    at org.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]    at org.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hbm2java]    at org.apache.tools.ant.Task.perform(Task.java:364)
[hbm2java]    at org.apache.tools.ant.Target.execute(Target.java:341)
[hbm2java]    at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hbm2java]    at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[hbm2java]    at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[hbm2java]    at org.apache.tools.ant.Main.runBuild(Main.java:673)
[hbm2java]    at org.apache.tools.ant.Main.startAnt(Main.java:188)
[hbm2java]    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[hbm2java]    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
[hbm2java] Caused by: org.hibernate.MappingException: class com.meller.stones.models.User not found while looking for property: id
[hbm2java]    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
[hbm2java]    at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:359)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:293)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
[hbm2java]    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
[hbm2java]    at org.hibernate.cfg.Configuration.add(Configuration.java:360)
[hbm2java]    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:397)
[hbm2java]    at org.hibernate.cfg.Configuration.addFile(Configuration.java:243)
[hbm2java]    ... 14 more
[hbm2java] Caused by: java.lang.ClassNotFoundException: com.meller.stones.models.User
[hbm2java]    at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1149)
[hbm2java]    at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
[hbm2java]    at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
[hbm2java]    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[hbm2java]    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[hbm2java]    at java.lang.Class.forName0(Native Method)
[hbm2java]    at java.lang.Class.forName(Class.java:141)
[hbm2java]    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
[hbm2java]    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
[hbm2java]    ... 22 more


Name and version of the database you are using:
Firebird 1.5



Every time i put an id-tag with a "<generator class="native"/>" property i get this exception. If i use the login-name as id no problem occurs...

Why?

_________________
/~


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 6:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you want hibernate to generate code for you ? then please but the type on the id tag - otherwise we have a hard time guessing it ;)

_________________
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.  [ 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.