Steve,
Here's the section of log, just prior to the exception (I've removed a big Hibernate DEBUG chunk that ouput a bunch of properties). I can see Hibernate processing the Period mapping, then the Course mapping. It then tries to resolve the courseDetails collection at which point it chokes.
(Configuration.java:836) DEBUG - null<-org.dom4j.tree.DefaultAttribute@1283052 [Attribute: name resource value "IGRSPeriod.hbm.xml"]
(Configuration.java:270) INFO - Mapping resource: IGRSPeriod.hbm.xml
(DTDEntityResolver.java:20) DEBUG - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
(DTDEntityResolver.java:29) DEBUG - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
(Binder.java:178) INFO - Mapping class: com.groundswell.igrs.model.IGRSPeriod -> tperiods
(Binder.java:394) DEBUG - Mapped property: periodId -> period_id, type: long
(Binder.java:394) DEBUG - Mapped property: periodNumber -> period_number, type: integer
(Binder.java:394) DEBUG - Mapped property: teacherId -> teacher_id, type: long
(Binder.java:394) DEBUG - Mapped property: quarterId -> quarter_id, type: long
(Binder.java:394) DEBUG - Mapped property: course -> course_id, type: com.groundswell.igrs.model.IGRSCourse
(Configuration.java:836) DEBUG - null<-org.dom4j.tree.DefaultAttribute@15b8520 [Attribute: name resource value "IGRSCourse.hbm.xml"]
(Configuration.java:270) INFO - Mapping resource: IGRSCourse.hbm.xml
(DTDEntityResolver.java:20) DEBUG - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
(DTDEntityResolver.java:29) DEBUG - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
(Binder.java:178) INFO - Mapping class: com.groundswell.igrs.model.IGRSCourse -> tcourses
(Binder.java:394) DEBUG - Mapped property: courseId -> course_id, type: long
(Binder.java:394) DEBUG - Mapped property: courseDetails, type: java.util.Set
(Configuration.java:885) INFO - Configured SessionFactory: null
(Configuration.java:492) INFO - processing one-to-many association mappings
(Binder.java:1134) DEBUG - Second pass for collection: com.groundswell.igrs.model.IGRSCourse.courseDetails
(GSHibernateDao.java:102) ERROR - currentSession(): Error getting new session...
hibernate.MappingException: Association references unmapped class: com.groundswell.igrs.model.IGRSCourseDetail
You asked:
"Are you certain you defined the CourseDetail class to the Hibernate configuration prior to obtaining the session factory? How are you doing this config?"
I'm not too cerain what you mean by this? I basically have an XXX.hbm.xml file for each of the three classes: Period, Course, CourseDetail. These are all placed in the app's WEB-INF/classes directory.
The SessionFactory is getting created when my first DAO method call is made. I'm using a class similar to the HibernateSession class example on the Hibernate site. My configuration is in a single hibernate.cfg.xml and I'm not using JNDI. Is this what you were asking?
I don't ever see where Hibernate is trying to load the IGRSCourseDetail map. (i.e. no message: "Mapping resource: IGRSCourseDetail" in the log anywhere).
Do you have any ideas for troubleshooting this further?
Thanks again for the help. I appreciate it.
Matt