-->
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.  [ 3 posts ] 
Author Message
 Post subject: Class not found exception
PostPosted: Tue Jan 12, 2010 12:38 pm 
Newbie

Joined: Mon Feb 02, 2009 5:31 pm
Posts: 8
Why am i getting this error? I have been doing the same thing as usual.


Quote:
sesssion factory failed org.hibernate.InvalidMappingException: Could not parse mapping document from resource database/items/T6Radio.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at database.HibernateUtil.<clinit>(HibernateUtil.java:19)
at database.DatabaseManager.getItem(DatabaseManager.java:1014)
at database.DatabaseManager.getTheRefSystem(DatabaseManager.java:955)
at database.DatabaseManager.primeDB(DatabaseManager.java:897)
at main.RTIMSmart.main(RTIMSmart.java:18)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource database/items/T6Radio.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:602)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1621)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)
at database.HibernateUtil.<clinit>(HibernateUtil.java:16)
... 4 more
Caused by: org.hibernate.MappingException: class T6Radio not found while looking for property: k_T6Radio
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:97)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:302)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:423)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:356)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)
at org.hibernate.cfg.Configuration.add(Configuration.java:702)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:537)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:599)
... 11 more
Caused by: java.lang.ClassNotFoundException: T6Radio
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:93)
... 19 more

Quote:
<?xml version="1.0"?>

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

<hibernate-mapping>
<class name="T6Radio" table="T6RADIO">
<id name="k_T6Radio" column="k_T6RADIO">
<generator class="native"/>
</id>

<many-to-one name="TheRtim"
column="K_RTIM"
not-null="true" class="database.items.RTIM"/>

<many-to-one name="ThePort"
column="PORT_ID"
not-null="true" class="database.items.Port"/>
</class>
</hibernate-mapping>

Quote:
package database.items;

public class T6Radio {

private int k_T6Radio;
private RTIM TheRtim ;
private Port ThePort;

public T6Radio(){

}

public RTIM getTheRtim() {
return TheRtim;
}
public void setTheRtim(RTIM theRtim) {
TheRtim = theRtim;
}
public Port getThePort() {
return ThePort;
}
public void setThePort(Port thePort) {
ThePort = thePort;
}
public int getk_T6Radio() {
return k_T6Radio;
}
public void setk_T6Radio(int kT6RADIO) {
k_T6Radio = kT6RADIO;
}

}


Top
 Profile  
 
 Post subject: Re: Class not found exception
PostPosted: Tue Jan 12, 2010 12:51 pm 
Newbie

Joined: Mon Feb 02, 2009 5:31 pm
Posts: 8
got it foprgot o put the path to the class in the xml.


Top
 Profile  
 
 Post subject: Re: Class not found exception
PostPosted: Sun Jan 17, 2010 1:05 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Indeed. These just usually boil down to finding the class at runtime.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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