Hi!
I'm using JBoss 3.0.3 with Tomcat 4.1, Hibernate 2.1beta3 and Struts. Hibernate is installed as described in
http://www.hibernate.org/66.html.
My project has the following structure:
/form/
/META-INF/
/META-INF/classes/de/sam/strutstest/action
/META-INF/classes/de/sam/strutstest/dto
/META-INF/classes/de/sam/strutstest/dto/mapping
/META-INF/classes/de/sam/strutstest/form
/META-INF/lib
/META-INF/classes/de/sam/strutstest/dto includes class User.class ("Hibernate class")
/META-INF/classes/de/sam/strutstest/dto/mapping includes mapping file User.hbm.xml
My jboss-service:
<server>
<mbean code="cirrus.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory, name=HibernateFactory">
<depends>jboss.jca:service=RARDeployer</depends>
<!-- Make it deploy ONLY after DataSource had been started -->
<depends>jboss.jca:service=LocalTxCM,name= MySqlTestDS</depends>
<attribute name="MapResources">
de/sam/strutstest/dto/mappings/User.hbm.xml
</attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
<attribute name="Datasource">java:/jdbc/MySqlTestDS</attribute>
<attribute name="Dialect">cirrus.hibernate.sql.MySQLDialect</attribute>
<attribute name="TransactionStrategy">cirrus.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">
cirrus.hibernate.transaction.JBossTransactionManagerLookup
</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">false</attribute>
<attribute name="UserTransactionName">java:/UserTransaction</attribute>
</mbean>
</server>
When running the Struts action using the User class, I get the following error:
javax.servlet.ServletException: Resource: de/sam/strutstest/dto/User.hbm.xml not found
But jboss-service.xml defines the attribute
<attribute name="MapResources">
de/sam/strutstest/dto/mappings/User.hbm.xml
</attribute>
I think Hibernate ignores the entry in jboss-service.xml. The jboss-service.xml is located in the /WEB-INF/ folder.