-->
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: MappingException: component class not found
PostPosted: Fri Dec 07, 2007 3:06 am 
Beginner
Beginner

Joined: Mon Sep 03, 2007 4:25 pm
Posts: 24
I used RevEng to generate java and hbm from a sample database. The java class matches one to one to the hbm files except for two id generator classes.

My HibernateFactory class has a cfg.addDirectory(modelDirectory) which points to the directory containing both the hbm and .class files. This always worked up to now, but in this case gets a
org.hibernate.MappingException: component class not found: model.OrderdetailsId

I don't know why hibernate can not find the id class (it definitely is there), when it found all the other non-id classes.

I then tried add all the .class one by one, instead of adding the directory. now I get
org.hibernate.MappingNotFoundException: resource: model/OrderdetailsId.hbm.xml
which is true, since there is no hbm for the id class.

what is really the problem? I figure it is not a classpath problem, because, hibernate does seem to find all the classes except the id classes. it seems to insist that for every java class, there must be a corresponding hbm file.

search the web came up with reports by other people of the same problem, but never answered. anyone has any insights?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 07, 2007 3:49 pm 
Beginner
Beginner

Joined: Mon Sep 03, 2007 4:25 pm
Posts: 24
apparently, it is a classpath problem.

I used URLClassLoader to explicitly load all classes, including the id generator classes, but still get the "component class not found exception". Is there something else I have to do to get Configuration to recognize that these classes exist?


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.