I'm a newbie at J2EE technoilogies, so this might not be relevant.
For my installation of JBoss (3.2.1) the UserTransaction service's JNDI
name is not "java:/UserTransaction" but "UserTransaction". This can be
verified on the JMX console.
Thus the correct syntax of a hibernate2 service would be:
<server>
<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=MySqlDS</depends>
<!-- Make it deploy ONLY after DataSource had been started -->
<attribute name="MapResources">mappings/Attribute.hbm.xml</attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
<attribute name="Datasource">java:/MySqlDS</attribute>
<attribute
name="Dialect">net.sf.hibernate.dialect.MySQLDialect</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">false</attribute>
<attribute name="UserTransactionName">UserTransaction</attribute>
</mbean>
</server>
This might save a couple of hours, for those who run into the same problem. |