1 Reply Latest reply on Feb 23, 2009 5:08 AM by aa ds

    JBoss 5.0.0.GA and Hibernate.cfg.xml in a WAR

    Elliot Lee Newbie

      Got a webapp that was working fine with JBoss 5.0.0.CR2. When I deploy it in 5.0.0.GA, I get:
      org.hibernate.MappingException: Association references unmapped class: edu.andrews.its.servies.donate.dao.Premium
      at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass

      I have a webapp that uses hibernate for a few objects. It contains its own WEB-INF/hibernate.cfg.xml, and uses org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean to set up and run this configuration, via the following lines in WEB-INF/applicationContext.xml:

      <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="configLocation" value="WEB-INF/hibernate.cfg.xml"/>
      <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/>

      hibernate.cfg.xml has five tags, four of which are for .hbm.xml files and one of which is for an annotated class:
      <mapping class="edu.andrews.its.services.donate.dao.Premium"/>
      <mapping resource="edu/andrews/its/services/donate/dao/Organization.hbm.xml"/>
      <mapping resource="edu/andrews/its/services/donate/dao/Campaign.hbm.xml"/>
      <mapping resource="edu/andrews/its/services/donate/dao/Donation.hbm.xml"/>
      <mapping resource="edu/andrews/its/services/donate/dao/DonationLevel.hbm.xml"/>

      Campaign.hbm.xml includes a line that says:
      <one-to-many class="edu.andrews.its.services.donate.dao.Premium"/>

      I've verified that Premium.class is included in the .war file.

      Any suggestions on what changed, or what I can look at to fix this?