We are deploying our hibernate domain classes and .hbm.xml files as a .sar file into the jboss deploy directory, and using an MBean to manage it.
The problem we are having is that occasionally on a hot deploy (dropping the .sar into the deploy directory while jboss is running), we get an exception something like "No persister found for class ..." Is there something that we should be doing in our code, or a trick to get around this problem?
Here are some setup details...
Using JBoss 3.2.1_tomcat-4.1.24 and hibernate-2.0.3
.hbm.xml files are generated with middlegen-r3
.java files are generated with hbm2java ant task
The .sar file is as follows:
hibernate\com\company\project\domain\MappedClass1.hbm.xml
hibernate\com\company\project\domain\MappedClass1.hbm.xml
meta-inf\application.xml
meta-inf\jboss-service.xml
Manifest.mf
Here is the MBean:
Code:
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory, name=HibernateFactory">
<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=LocalTxCM,name=MyDbDS</depends>
<!-- Make it deploy ONLY after DataSource had been started -->
<attribute name="MapResources">hibernate\com\company\project\domain\MappedClass1.hbm.xml,hibernate\com\company\project\domain\MappedClass1.hbm.xml
</attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
<attribute name="Datasource">java:/MyDbDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.OracleDialect</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">true</attribute>
<attribute name="UserTransactionName">UserTransaction</attribute>
</mbean>
Thanks for any insight that anyone can provide!
-Kat