Section 5.7. Hibernate Checklist

5.7. Hibernate Checklist

Before we get to the actual HibernateCarDAO , let's recap what we've done up to this point. We:

  • Added Hibernate tags to the CarDTO and created an Ant task to create the Mapping File (cardto.hbm.xml)

  • Created a Hibernate MBean service descriptor (hibernate-service.xml)

  • Bundled these two files up in a HAR (common/build/distribution/jaw.har)

  • Created a jboss-app.xml file so JBoss would know how to deploy the HAR included in the EAR

  • Created a global JNDI reference to the Session Factory in jboss-web.xml (java:/hibernate/SessionFactory)

  • Created a local JNDI reference to the Session Factory in web.xml conforming to the J2EE ENC naming style (java:comp/env/hibernate/SessionFactory)

  • Modified the ServiceLocator class that encapsulates all JNDI lookups to return a Hibernate Session

JBoss 4.0.2 and Hibernate 3.0.2 Issues

Bugs are facts of life. Even though JBoss and Hibernate are excellent products, JBoss 4.0.2 and Hibernate 3.0.2 straight out of the box have one significant problema core JAR file that inadvertently was left out of the distribution. The Apache Jakarta Commons Collections JAR needs to be downloaded separately and installed for Hibernate to work correctly. Visit the website ( and download Version 2.1.1 of the JAR. Then copy it to one of the following directories:

  • $JBOSS_HOME/server/default/lib

  • $JBOSS_HOME/server/default/deploy/jboss-hibernate.deployer

This issue should be resolved in JBoss 4.0.3.

JBoss at Work. A Practical Guide
JBoss at Work: A Practical Guide
ISBN: 0596007345
EAN: 2147483647
Year: 2004
Pages: 197

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: