Saturday, October 1, 2011

How to use Hibernate 3 as JPA provider in JBoss AS7

Jboss AS7 come with Hibernate 4 (even if it still in beta :-)! if you still use hibernate 3 as JPA provider in your application and you want to deploy it in Jboss AS7 ... you may know it's possible ... Humm yes you can do it just by creating a module for hibernate3 under your Jboss AS7 (how powerful server is !). So you just need to:

* Create a folder in AS7_HOME\modules\org\hibernate\3 for slot 3 to hold your hibernate 3 jars.

* Copy the hibernate 3 associated jars into this folder. For example:


* Create the AS7_HOME/modules/org/hibernate/3/module.xml file with contents :

That's it, your module now is available on your jboss 7 server, all you nedd to link it with your application is to add the followed property to your persistence unit :

Note the org.hibernate:3 on your property ;-)


  1. Cool, nice to know. But how do you generate the dependencies-tag in the module.xml? I want to add other module ^^


  2. There is a cyclic reference on hibernate slot number in module "".