1 Reply Latest reply on Sep 7, 2007 9:37 AM by homer homer

    Using Hibernate's ScanForMappingsEnabled

    homer homer Newbie

      I have an EAR that contains a WAR and HAR. The HAR only contains the hibernate-service.xml which looks like this:

       <mbean code="org.jboss.hibernate.jmx.Hibernate"
       <attribute name="DatasourceName">java:/MySqlDS</attribute>
       <attribute name="Dialect">
       <attribute name="SessionFactoryName">
       <attribute name="CacheProviderClass">
       <attribute name="ShowSqlEnabled">true</attribute>
       <attribute name="ScanForMappingsEnabled">true</attribute>

      The WAR has some servlets and also has a jar (in WEB-INF) that contains the hibernate mapping and class files.

      When the servlet tries to do a save with one of these hibernate objects I get an exception: org.hibernate.MappingException: Unknown entity

      I looked at the Jboss logs when the EAR deploys and it appears that the ONLY place being searched for the hibernate mappings is in the HAR file:

      2007-09-07 09:11:30,627 INFO [org.hibernate.cfg.Configuration] Searching for mapping documents in jar: tmp3596messagebrokerpersistence.har

      It is my understanding that with ScanForMappingsEnabled set to true its supposed to scan the entire EAR for the mapping files. Am I missing something or doing something wrong?