Version 1

    If you happen to have chosen to use the "No-DTO" pattern with GWT using Gilead project here is a quick tip on migration from JBoss AS 5.1 to AS 7.

     

    Gilead comes with JBossUtil where you supply reference to EMF (EntityManagerFactory) you pulled from JNDI. However it is using class no longer present in the AS

     

    import org.jboss.jpa.injection.InjectedEntityManagerFactory;
    

     

    thus you will end up with NCDFs exceptions. Easy fix is to switch to HibernateJpaUtil which uses EMF directly.

     

    However, the Gilead is compatible with Hibernate 3.x generation. JBoss AS 7.x by default comes with Hibernate 4.x which is not compatible with Gilead as is. What you can do for now, is just to bundle old Hibernate jars in my application. There are multiple ways to do this, refer to this document. here is one lazy way to do it: packing jars make your application bigger in size but makes the build and distribution process a little easier.

     

    Here is a quick tip, to package the jars in the EAR at the correct location, add this to your pom:

     

    ...
      <build>
          <finalName>myearname</finalName>
          <plugins>
             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <configuration>
                   <!-- Tell maven to package in ear/lib for AS7 -->
                   <defaultLibBundleDir>lib</defaultLibBundleDir>
    ...
    

     

    Also if you depended on whole JBoss AS 5.1 stack, then you might just want to take off the Hibernate part, which is to be added (replace the AS ones) to your pom.xml:

     

    ...
          <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-core</artifactId>
             <version>3.5.6-Final</version>
          </dependency>
          <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-envers</artifactId>
             <version>3.5.6-Final</version>
          </dependency>
    ...
    

     

    Enjoy.