Red Hat
Aug 18, 2011
by Scott Marlow

AS 7.0.1 is released!!!

AS 7.0.1 is released, which includes improvements for using different persistence providers (beside the included Hibernate 4.0.0). The framework is in place to plug in Hibernate 3.5 (or greater) persistence providers. This addressed user feedback, that its important to use Hibernate 3.x on AS7, to give more time before migrating to Hibernate 4.0.0. Switching your application to Hibernate 4.x, should be done as soon as possible. Hibernate 4.0.0 has been modified to support the AS7 modular classloading environment and JBoss logging (and other many other improvements).

Drop in a Hibernate 3.6.6.Final module

By default, JPA applications will use Hibernate 4.0.0 with AS7, unless you add property set to org.hibernate:3 to your persistence.xml properties list. You also need to create an org.hibernate:3 module that represents the Hibernate 3.6.6.Final release jars that will be used by your application. I downloaded the hibernate-distribution-3.6.6.Final for creating the new module.

Steps to create the Hibernate 3.6.6.Final module

  1. Create as/modules/org/hibernate/3 folder
  2. Copy jars from the hibernate-distribution-3.6.6.Final folder into the as/modules/org/hibernate/3 folder
  3. Create as/modules/org/hibernate/3/module.xml file
  4. update your persistence.xml to use the org.hibernate:3 module
<!-- as/modules/org/hibernate/3/module.xml file -->
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.hibernate" slot="3">
        <resource-root path="hibernate3.jar"/>
        <resource-root path="javassist-3.12.0.GA.jar"/>
        <resource-root path="antlr-2.7.6.jar"/>  
        <resource-root path="commons-collections.jar"/>  
        <resource-root path="dom4j-1.6.1.jar"/>  
        <!-- Insert other Hibernate 3 jars to be used here -->
        <module name="" slot="3"/>
        <module name="asm.asm"/>
        <module name="javax.api"/>
        <module name="javax.persistence.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.validation.api"/>
        <module name="org.apache.ant"/>
        <module name="org.infinispan"/>
        <module name="org.javassist"/>
        <module name="org.slf4j"/>
<!-- persistence.xml using Hibernate 3.6.6.Final -->
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="" version="1.0">
<persistence-unit name="GameOfThrones_pu">
    <description>my Hibernate 3 persistence unit.</description>
        <property name="" value="org.hibernate:3"/>

Example of an AS7 (Arquillian) unit test using the org.hibernate:3 module. Note that this test is @Ignored until we arrange for the org.hibernate:3 module to be created by the test build.

I could of created a standalone application but I prefer to push the awesome Arquillian project! ;) I hope that you will contribute similar JPA tests to the AS7 project when you can.

Experimental use of OGM on AS 7.0.1

I wanted to see if I could create an AS7 unit test that created a few entities with (OGM). To accomplish this, I checked out a copy of the OGM sources at and built them.

cd work
git clone git://
Cloning into hibernate-ogm...
  remote: Counting objects: 4371, done.
  remote: Compressing objects: 100% (1357/1357), done.
  remote: Total 4371 (delta 1694), reused 4262 (delta 1599)
  Receiving objects: 100% (4371/4371), 1.17 MiB, done.
  Resolving deltas: 100% (1694/1694), done.

cd hibernate-ogm
mvn clean install
... lots of output from building ogm jars....

Folder hibernate-ogm-core/target will contain hibernate-ogm-core-3.0.0-SNAPSHOT.jar 

Next, you need to build my experimental OGM branch for AS7 (oh yeah, you need a few tools maven and git).

cd ..
git clone git://
cd jboss-as
git checkout ogm
./ clean install
OR build.bat clean install

  1. Follow instructions above for creating the org.hibernate:3 module
  2. Create as/modules/org/hibernate/ogm folder
  3. Copy hibernate-ogm-core-3.0.0-SNAPSHOT.jar that you just built (from OGM build) into the as/modules/org/hibernate/ogm folder
  4. Create as/modules/org/hibernate/ogm/module.xml file
  5. update your persistence.xml to use the org.hibernate:3 module and org.hibernate:ogm providerModule.
  6. Create a local-only infinispan.xml for your application.

Or to run the OGM unit test that I added (after manually creating the org.hibernate:ogm module), run the unit test with these steps:

  1. cd testsuite
  2. cd compat
  3. mvn clean install -DallTests

The unit test will run one instance of AS7 and use Infinispan in local-only mode. A few entities will be created (under a JTA transaction) and read back. If you see error Could not deploy to container, open the ./target/jbossas/standalone/log/server.log to see what went wrong (did you create the as/modules/org/hibernate/3 and as/modules/org/hibernate/ogm modules?)

See OGM documentation for more about OGM.

Like I said before, using OGM on AS7, is experimental at this point. ;)

AS 7.0.1 JPA documentation

The documentation for AS7 JPA is available here.

using EclipseLink

I started a new git repo for working on EclipseLink integration. This will require coordination with the EclipseLink project as changes are probably required there as well. EclipseLink has the property that can be set to JBoss but that doesn't support AS7 yet. Also, we need to fix the PersistenceUnitMetadata.getNewTempClassLoader() in AS7. Depending on the level of interest, the EclipseLink integration in AS7 will come together (more of the work may be inside of the EclipeLink project itself).

Community contributions are welcome

Please continue to ask/answer questions on the AS7 user discussion forums. I would like to work with a few more community members on further code changes to the JPA integration support in AS7. If you would like to volunteer, find Scott Marlow on IRC (irc:// As well as working on integration support with other persistence providers.

Original Post