Hi John,
First of all the name inside the ds.xml is the JNDI name it will bound to
I normally build a sar (har if JBoss > 3.2.6 ) file that contains all files required. This can be done by an ant task like the following (It's for JBoss 3.2.5) :
Code:
<target name="build-sar" depends="compile">
<jar jarfile="${DIST}/hibernate.sar" index="true">
<metainf dir="${basedir}/conf">
<include name="jboss-service.xml" />
</metainf>
<fileset dir="${basedir}/src/java" includes="mappings/*.hbm.xml" />
<fileset dir="${LIB}">
<include name="cglib-full-2.0.2.jar" />
<include name="asm.jar" />
<include name="odmg-3.0.jar" />
<include name="commons-collections-2.1.1.jar" />
<include name="commons-lang-1.0.1.jar" />
<include name="commons-logging-1.0.4.jar" />
<include name="dom4j-1.4.jar" />
<include name="ehcache-0.9.jar" />
<include name="hibernate2.jar" />
</fileset>
<fileset dir="${basedir}/conf" includes="treecache.xml"/>
<fileset dir="${BUILD}/classes" includes="org/mytest/objects/*.class" />
</jar>
</target>
The jboss-service.xml looks like:
Code:
<server>
<mbean code="org.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateTicketsystem,name=HibernateService">
<depends>jboss.jca:service=RARDeployer</depends>
<!-- the following line must be changed to MySQLDS if the database is MySQL else PostgresDS -->
<!--depends>jboss.jca:service=LocalTxCM,name=PostgresDS</depends-->
<!--depends>jboss.jca:service=LocalTxCM,name=MySQLDS</depends-->
<attribute name="MapResources">mappings/MasterAccount.hbm.xml, mappings/SubAccount.hbm.xml,
....
</attribute>
<attribute name="JndiName">java:/HibernateService</attribute>
<!-- the following line must be changed to java:/MySQLDS if the database is MySQL else PostgresDS-->
<attribute name="Datasource">java:/PostgresDS</attribute>
<!--attribute name="Datasource">java:/MySQLDS</attribute-->
<!-- the following line must be changed to org.hibernate.dialect.MySQLDialect if the database is MySQL else PostgreSQLDialect-->
<attribute name="Dialect">org.hibernate.dialect.PostgreSQLDialect</attribute>
<!--attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute-->
<attribute name="TransactionStrategy">org.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="CacheProvider">org.hibernate.cache.TreeCacheProvider</attribute>
<attribute name="DefaultSchema"></attribute>
<attribute name="JdbcBatchSize">20</attribute>
<attribute name="MaximumFetchDepth">1</attribute>
<attribute name="ShowSql">true</attribute>
<attribute name="QueryCacheEnabled">true</attribute>
<attribute name="ScrollableResultSetsEnabled">false</attribute>
<attribute name="UserTransactionName">UserTransaction</attribute>
</mbean>
</server>
For 3.2.6 take a look at the JBoss Wiki there should also be a detailed explaination. ;)