[rhq] Branch 'rhq-on-as7' - .classpath modules/common modules/core modules/enterprise modules/helpers modules/integration-tests modules/jopr modules/plugins pom.xml

Jay Shaughnessy jshaughn at fedoraproject.org
Fri Aug 31 16:05:06 UTC 2012


 .classpath                                                                                                             |    7 
 modules/common/pom.xml                                                                                                 |   28 ---
 modules/core/arquillian-integration/container/pom.xml                                                                  |   27 ---
 modules/core/client-api/pom.xml                                                                                        |   26 +--
 modules/core/domain/pom.xml                                                                                            |   79 +---------
 modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDampening.java                                        |    9 -
 modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java                                       |   15 -
 modules/core/domain/src/main/java/org/rhq/core/domain/authz/Role.java                                                  |   13 +
 modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java                                   |    4 
 modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java                                         |   31 ++-
 modules/core/domain/src/test/java/org/rhq/core/domain/test/AbstractEJB3Test.java                                       |   30 +++
 modules/core/domain/src/test/java/org/rhq/core/domain/test/QueryAllTest.java                                           |    2 
 modules/core/gui/pom.xml                                                                                               |   30 ---
 modules/core/gui/src/main/java/org/rhq/core/gui/util/FacesContextUtility.java                                          |    3 
 modules/core/plugin-api/pom.xml                                                                                        |   16 --
 modules/core/plugin-container/pom.xml                                                                                  |   16 --
 modules/core/plugindoc/pom.xml                                                                                         |   13 -
 modules/enterprise/agent/pom.xml                                                                                       |   17 --
 modules/enterprise/binding/pom.xml                                                                                     |   37 ++--
 modules/enterprise/gui/content_http-war/pom.xml                                                                        |   29 ---
 modules/enterprise/gui/coregui/pom.xml                                                                                 |   43 +----
 modules/enterprise/gui/portal-war/pom.xml                                                                              |   47 +----
 modules/enterprise/gui/rest-war/pom.xml                                                                                |   26 ---
 modules/enterprise/remoting/cli/pom.xml                                                                                |    8 -
 modules/enterprise/remoting/client-api/pom.xml                                                                         |   26 ---
 modules/enterprise/remoting/client-deps/pom.xml                                                                        |    6 
 modules/enterprise/server/container/pom.xml                                                                            |    2 
 modules/enterprise/server/itests/pom.xml                                                                               |   34 ----
 modules/enterprise/server/jar/pom.xml                                                                                  |   47 ++---
 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java                    |    7 
 modules/enterprise/server/plugins/alert-sms/pom.xml                                                                    |   21 --
 modules/enterprise/server/plugins/ant-bundle/pom.xml                                                                   |   17 --
 modules/enterprise/server/plugins/drift-rhq/pom.xml                                                                    |   19 --
 modules/enterprise/server/plugins/filetemplate-bundle/pom.xml                                                          |   19 --
 modules/enterprise/server/plugins/pom.xml                                                                              |   20 --
 modules/enterprise/server/safe-invoker/pom.xml                                                                         |   11 -
 modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java |    4 
 modules/enterprise/server/xml-schemas/pom.xml                                                                          |   11 -
 modules/helpers/inventory-serializer/pom.xml                                                                           |   22 --
 modules/integration-tests/jndi-access/jndi-access-test/pom.xml                                                         |   37 ----
 modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml                                                                 |   15 -
 modules/plugins/jboss-as-5/testsuite/pom.xml                                                                           |   20 --
 pom.xml                                                                                                                |   50 +++---
 43 files changed, 212 insertions(+), 732 deletions(-)

New commits:
commit d60bd462809923b5dd19d1a115abeac07c91ab34
Author: Jay Shaughnessy <jshaughn at jshaughn.csb>
Date:   Fri Aug 31 11:46:00 2012 -0400

    First pass at Hibernate upgrade. We will try and leverage the Hibernate4
    modules provided with AS7.
    - Changes to remove use of deprecated features that were removed in H4
      - new mechanism for createBlob
      - new ElementCollection annotation
      - new mechanism to work with Connection
    - Dependency changes to new jar structure
    - Removal of legacy annotations and jpa deps for compile issues
    - Also leverage AS7 provided antlr jar, removing transitive deps pulling in
      multiple jars/versions

diff --git a/.classpath b/.classpath
index 5e879c9..5a1b13d 100644
--- a/.classpath
+++ b/.classpath
@@ -220,7 +220,6 @@
 	<classpathentry exported="true" kind="var" path="M2_REPO/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/jboss/jboss-embeddable-ejb3/jboss-ejb3-all/1.0.0.Alpha9/jboss-ejb3-all-1.0.0.Alpha9.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/jboss/jbpm/3.1.1/jbpm-3.1.1.jar"/>
-	<classpathentry exported="true" kind="var" path="M2_REPO/jboss/jboss-embeddable-ejb3/hibernate-all/1.0.0.Alpha9/hibernate-all-1.0.0.Alpha9.jar" sourcepath="/M2_REPO/hibernate/hibernate3/3.2.r14201-2/hibernate3-3.2.r14201-2.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/jetbrains/annotations/7.0.2/annotations-7.0.2.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/apache/ant/ant-launcher/1.8.0/ant-launcher-1.8.0.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar"/>
@@ -252,7 +251,6 @@
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/freemarker/freemarker/2.3.11/freemarker-2.3.11.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/seam/jboss-seam/2.1.0.SP1/jboss-seam-2.1.0.SP1.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/seam/jboss-seam-ui/2.1.0.SP1/jboss-seam-ui-2.1.0.SP1.jar"/>
-	<classpathentry exported="true" kind="var" path="M2_REPO/hibernate/hibernate3/3.2.r14201-2/hibernate3-3.2.r14201-2.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/jline/jline/0.9.94/jline-0.9.94.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/net/sf/opencsv/opencsv/1.8/opencsv-1.8.jar"/>
@@ -285,6 +283,11 @@
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/mongodb/mongo-java-driver/2.6.5/mongo-java-driver-2.6.5.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/com/googlecode/java-diff-utils/diffutils/1.2.1/diffutils-1.2.1.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/com/google/code/morphia/morphia/0.99/morphia-0.99.jar"/>
+	<classpathentry exported="true" kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.5.6-Final/hibernate-annotations-3.5.6-Final.jar"/>	
+	<classpathentry exported="true" kind="var" path="M2_REPO/org/hibernate/hibernate-core/4.0.1.Final/hibernate-core-4.0.1.Final.jar"/>	
+	<classpathentry exported="true" kind="var" path="M2_REPO/org/hibernate/hibernate-entitymanager/4.0.1.Final/hibernate-entitymanager-4.0.1.Final.jar"/>
+	<classpathentry exported="true" kind="var" path="M2_REPO/org/hibernate/hibernate-validator/4.2.0.Final/hibernate-validator-4.2.0.Final.jar"/>	
+	<classpathentry exported="true" kind="var" path="M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.1.Final/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/spec/javax/servlet/jboss-servlet-api_3.0_spec/1.0.1.Final/jboss-servlet-api_3.0_spec-1.0.1.Final.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/msc/jboss-msc/1.0.2.GA/jboss-msc-1.0.2.GA.jar"/>
 	<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/jboss-dmr/1.1.1.Final/jboss-dmr-1.1.1.Final.jar"/>
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
index f364ae9..d9bad29 100644
--- a/modules/common/pom.xml
+++ b/modules/common/pom.xml
@@ -14,11 +14,6 @@
    <name>RHQ Common Plugin Libraries</name>
    <description>parent POM for all RHQ common plugin libraries</description>
 
-   <properties>
-      <hibernate-all.version>1.0.0.Alpha9</hibernate-all.version>
-      <persistence-api.version>1.0</persistence-api.version>
-   </properties>
-
    <dependencies>
       <dependency>
          <groupId>${project.groupId}</groupId>
@@ -27,29 +22,6 @@
          <scope>provided</scope> <!-- by PC -->
       </dependency>
 
-
-      <!--
-         TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent classes.
-         It is fixed in JDK 6.
-      -->
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>${persistence-api.version}</version>
-         <scope>provided</scope> <!-- by ON container -->
-      </dependency>
-
-      <!--
-         TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent classes;
-         it is fixed in JDK 6.
-      -->
-      <dependency>
-         <groupId>jboss.jboss-embeddable-ejb3</groupId>
-         <artifactId>hibernate-all</artifactId>
-         <version>${hibernate-all.version}</version>
-         <scope>provided</scope> <!-- by ON container -->
-      </dependency>
-
    </dependencies>
 
    <modules>
diff --git a/modules/core/arquillian-integration/container/pom.xml b/modules/core/arquillian-integration/container/pom.xml
index 16b7bdb..583047e 100644
--- a/modules/core/arquillian-integration/container/pom.xml
+++ b/modules/core/arquillian-integration/container/pom.xml
@@ -121,31 +121,8 @@
             <artifactId>arquillian-testng-container</artifactId>
             <scope>test</scope>
         </dependency>
-
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>hibernate</groupId>
-            <artifactId>hibernate3</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>hibernate-annotations</groupId>
-            <artifactId>hibernate-annotations</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>hibernate-entitymanager</groupId>
-            <artifactId>hibernate-entitymanager</artifactId>
-            <scope>provided</scope>
-        </dependency>
+        
     </dependencies>
+    
 </project>
 
diff --git a/modules/core/client-api/pom.xml b/modules/core/client-api/pom.xml
index c8cd401..819cbff 100644
--- a/modules/core/client-api/pom.xml
+++ b/modules/core/client-api/pom.xml
@@ -20,42 +20,32 @@
 
     <dependency>
       <groupId>${rhq.groupId}</groupId>
-      <artifactId>rhq-core-domain</artifactId>
+      <artifactId>rhq-core-util</artifactId>
       <version>${project.version}</version>
-      <scope>provided</scope>
+      <scope>provided</scope> <!-- by ${rhq.earName} -->
     </dependency>
 
     <dependency>
       <groupId>${rhq.groupId}</groupId>
-      <artifactId>rhq-core-comm-api</artifactId>
+      <artifactId>rhq-core-domain</artifactId>
       <version>${project.version}</version>
       <scope>provided</scope>
     </dependency>
 
     <dependency>
       <groupId>${rhq.groupId}</groupId>
-      <artifactId>rhq-common-drift</artifactId>
+      <artifactId>rhq-core-comm-api</artifactId>
       <version>${project.version}</version>
-    </dependency>
-
-      <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-                 available when compiling dependent classes; it is fixed in JDK 6. -->
-
-    <dependency>
-      <groupId>jboss.jboss-embeddable-ejb3</groupId>
-      <artifactId>hibernate-all</artifactId>
-      <version>1.0.0.Alpha9</version>
       <scope>provided</scope>
-         <!-- set scope to 'provided', so Hibernate annotations can be used in the entities -->
     </dependency>
 
     <dependency>
-      <groupId>jboss.jboss-embeddable-ejb3</groupId>
-      <artifactId>jboss-ejb3-all</artifactId>
-      <version>1.0.0.Alpha9</version>
+      <groupId>${rhq.groupId}</groupId>
+      <artifactId>rhq-common-drift</artifactId>
+      <version>${project.version}</version>
       <scope>provided</scope>
     </dependency>
-
+ 
     <dependency>
       <groupId>javax.xml.bind</groupId>
       <artifactId>jaxb-api</artifactId>
diff --git a/modules/core/domain/pom.xml b/modules/core/domain/pom.xml
index 41e2cb9..4850a68 100644
--- a/modules/core/domain/pom.xml
+++ b/modules/core/domain/pom.xml
@@ -29,35 +29,25 @@
          <version>${project.version}</version>
       </dependency>
 
-      <!-- required by PersistenceUtil (provided by AS) -->
-      <!-- required also by hibernate Instrument task. (but use compile scope for this) -->
+      <!-- provided by AS7 -->
       <dependency>
-         <groupId>hibernate</groupId>
-         <artifactId>hibernate3</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>compile</scope>
-      </dependency>
-
-      <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-entitymanager</artifactId>
+         <scope>provided</scope>
       </dependency>
 
-      <!-- required by PersistenceUtil and EJB3 Embedded -->
+      <!-- required by PersistenceUtil (provided by AS7) -->
       <dependency>
-         <groupId>hibernate-entitymanager</groupId>
-         <artifactId>hibernate-entitymanager</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-core</artifactId>
+         <scope>provided</scope>
       </dependency>
 
+      <!-- provided by AS7 -->
       <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope> <!-- by JBossAS -->
+         <groupId>org.hibernate.javax.persistence</groupId>
+         <artifactId>hibernate-jpa-2.0-api</artifactId>
+         <scope>provided</scope>    
       </dependency>
 
       <dependency>
@@ -73,23 +63,6 @@
        <scope>provided</scope> <!-- by JBossAS -->
      </dependency>
 
-      <!--  needed for hibernate Instrument task
-      <dependency>
-         <groupId>javassist</groupId>
-         <artifactId>javassist</artifactId>
-         <version>${jboss-javassist.version}</version>
-         <scope>runtime</scope>
-      </dependency>
-      -->
-
-      <!--  needed for hibernate Instrument task
-      <dependency>
-        <groupId>commons-logging</groupId>
-        <artifactId>commons-logging</artifactId>
-        <scope>runtime</scope>
-      </dependency>
-      -->
-
       <!-- needed if you want to use the logging JDBC wrapper
       <dependency>
          <groupId>org.rhq</groupId>
@@ -98,16 +71,6 @@
       </dependency>
       -->
 
-      <!--
-      <!- - so Seam annotations can be used in the entities - ->
-      <dependency>
-         <groupId>jboss</groupId>
-         <artifactId>jboss-seam</artifactId>
-         <version>${seam.version}</version>
-         <scope>provided</scope> <!- - by ${rhq.earName} - ->
-      </dependency>
-      -->
-
       <!--================ Test Deps ================-->
       <dependency>
           <groupId>${project.groupId}</groupId>
@@ -151,28 +114,11 @@
          <scope>test</scope>
       </dependency>
 
-<!--
-      <dependency>
-         <groupId>jboss.jboss-embeddable-ejb3</groupId>
-         <artifactId>hibernate-all</artifactId>
-         <version>${jboss-embeddable-ejb3.version}</version>
-         <scope>test</scope>
-      </dependency>
-
-      <dependency>
-         <groupId>jboss.jboss-embeddable-ejb3</groupId>
-         <artifactId>thirdparty-all</artifactId>
-         <version>${jboss-embeddable-ejb3.version}</version>
-         <scope>test</scope>
-      </dependency>
--->
-
       <!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
 
       <dependency>
          <groupId>antlr</groupId>
          <artifactId>antlr</artifactId>
-         <version>2.7.7</version>
          <scope>test</scope>
       </dependency>
 
@@ -344,6 +290,7 @@
                            Using it turned out not t be a current option since the instrumented class carries with
                            it hibernate imports that we can't put in the domain jar since it's used on the Agent and
                            in Remote Java Clients. But this worked, so here ya go...
+                           (update: this may no longer work given the upgrade to H4, also, deps would have changed)                          
                               <taskdef name="instrument" classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
                                  <classpath>
                                     <path refid="maven.runtime.classpath" />
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDampening.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDampening.java
index 17fa633..0f2d0b1 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDampening.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDampening.java
@@ -30,7 +30,6 @@ import javax.persistence.Column;
 import javax.persistence.Embeddable;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
-import javax.persistence.JoinColumn;
 import javax.persistence.OneToMany;
 
 @Embeddable
@@ -85,12 +84,12 @@ public class AlertDampening implements java.io.Serializable {
     @Enumerated(EnumType.ORDINAL)
     private TimeUnits periodUnits;
 
-    //@OneToMany(cascade = CascadeType.ALL) <-- used to be unidirectional, but that obfuscated AlertDampeningEvent queries
-    @OneToMany(mappedBy = "alertDefinition", cascade = CascadeType.ALL)
+    // This is required for cascade behavior. We want to be able to cascade delete the AlertDampeningEvents when an
+    // AlertDefinition is removed from the db, due to deleting a Resource from inventory.     
+    @OneToMany(mappedBy = "alertDefinition", cascade = { CascadeType.REFRESH, CascadeType.REMOVE })
     @org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
-    @JoinColumn(name = "ID")
     private Set<AlertDampeningEvent> alertDampeningEvents = new HashSet<AlertDampeningEvent>();
-
+    
     protected AlertDampening() {
     } // JPA
 
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
index 71ca46c..fecb7d1 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
@@ -24,7 +24,6 @@ package org.rhq.core.domain.alert;
 
 import java.io.Serializable;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
@@ -294,6 +293,7 @@ public class AlertDefinition implements Serializable {
 
     // do not cascade remove - group removal will be detaching children alert defs from the group def,
     // and then letting the children be deleted slowly by existing alert def removal mechanisms
+    @SuppressWarnings("unused")
     @OneToMany(mappedBy = "groupAlertDefinition", fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST })
     @OrderBy
     private Set<AlertDefinition> groupAlertDefinitionChildren = new LinkedHashSet<AlertDefinition>();
@@ -368,15 +368,6 @@ public class AlertDefinition implements Serializable {
     @org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
     private List<AlertNotification> alertNotifications = new ArrayList<AlertNotification>();
 
-    /*
-     * As of Sept 29, 2007 there is no reason to expose this at the java layer.  However, this is required if we want to
-     * be able to cascade delete the AlertDampeningEvents when an AlertDefinition is removed from the db, due to
-     * deleting a Resource from inventory.
-     */
-    @OneToMany(mappedBy = "alertDefinition", cascade = { CascadeType.REFRESH, CascadeType.REMOVE })
-    @org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
-    private Set<AlertDampeningEvent> alertDampeningEvents = new HashSet<AlertDampeningEvent>();
-
     /**
      * NOTE: This field is currently not accessed, so we don't need cascading for PERSIST/MERGE/REFRESH. However, we
      * still need cascading for REMOVE, so we don't get FK constraint violations when an Alert is removed.
@@ -725,11 +716,11 @@ public class AlertDefinition implements Serializable {
     }
 
     public Set<AlertDampeningEvent> getAlertDampeningEvents() {
-        return alertDampeningEvents;
+        return alertDampening.getAlertDampeningEvents();
     }
 
     public boolean removeAlertDampeningEvent(AlertDampeningEvent event) {
-        return alertDampeningEvents.remove(event);
+        return alertDampening.getAlertDampeningEvents().remove(event);
     }
 
     public void calculateContext() {
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Role.java b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Role.java
index 842a1b4..e25c81b 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Role.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/authz/Role.java
@@ -27,14 +27,17 @@ import java.util.HashSet;
 import java.util.Set;
 
 import javax.persistence.CascadeType;
+import javax.persistence.CollectionTable;
 import javax.persistence.Column;
+import javax.persistence.ElementCollection;
 import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
 import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
 import javax.persistence.ManyToMany;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
@@ -43,7 +46,6 @@ import javax.persistence.SequenceGenerator;
 import javax.persistence.Table;
 
 import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CollectionOfElements;
 import org.jetbrains.annotations.NotNull;
 
 import org.rhq.core.domain.auth.Subject;
@@ -119,10 +121,11 @@ public class Role implements Serializable {
     @ManyToMany(mappedBy = "roles")
     private Set<ResourceGroup> resourceGroups = new HashSet<org.rhq.core.domain.resource.group.ResourceGroup>();
 
+    @ElementCollection(targetClass = Permission.class, fetch = FetchType.EAGER)
+    @CollectionTable(name = "RHQ_PERMISSION", joinColumns = { @JoinColumn(name = "ROLE_ID") })
+    @JoinColumn(name = "OPERATION", nullable = false)
+    @Enumerated(EnumType.ORDINAL)
     @Cascade( { org.hibernate.annotations.CascadeType.ALL })
-    @CollectionOfElements(fetch = FetchType.EAGER)
-    @Column(name = "operation")
-    @JoinTable(name = "RHQ_PERMISSION", joinColumns = @JoinColumn(name = "ROLE_ID"))
     private Set<Permission> permissions = new HashSet<Permission>();
 
     public Role() {
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java b/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java
index 662d97c..f412549 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java
@@ -41,8 +41,8 @@ import org.apache.commons.logging.LogFactory;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
 import org.hibernate.ejb.EntityManagerImpl;
-import org.hibernate.engine.NamedQueryDefinition;
-import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.engine.spi.NamedQueryDefinition;
+import org.hibernate.engine.spi.SessionFactoryImplementor;
 import org.hibernate.jmx.StatisticsService;
 import org.hibernate.stat.Statistics;
 import org.hibernate.type.CustomType;
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java
index 50a061b..32014dc 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/drift/DriftFileTest.java
@@ -1,5 +1,7 @@
 package org.rhq.core.domain.drift;
 
+import static org.apache.commons.io.IOUtils.toInputStream;
+
 import java.io.BufferedInputStream;
 import java.io.BufferedWriter;
 import java.io.File;
@@ -11,15 +13,15 @@ import java.sql.Blob;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.persistence.EntityManager;
+
 import org.apache.commons.io.IOUtils;
-import org.hibernate.Hibernate;
+import org.hibernate.Session;
 import org.testng.annotations.Test;
 
 import org.rhq.core.util.MessageDigestGenerator;
 import org.rhq.test.TransactionCallback;
 
-import static org.apache.commons.io.IOUtils.toInputStream;
-
 public class DriftFileTest extends DriftDataAccessTest {
 
     static private final MessageDigestGenerator digestGen = new MessageDigestGenerator(MessageDigestGenerator.SHA_256);
@@ -35,7 +37,9 @@ public class DriftFileTest extends DriftDataAccessTest {
         final JPADriftFileBits df1 = new JPADriftFileBits();
         df1.setHashId(hashId);
         df1.setDataSize((long) content.length());
-        df1.setData(Hibernate.createBlob(toInputStream(content), content.length()));
+        EntityManager em = getEntityManager();
+        Session session = (Session) em.getDelegate();
+        df1.setData(session.getLobHelper().createBlob(toInputStream(content), content.length()));
 
         executeInTransaction(new TransactionCallback() {
             @Override
@@ -49,8 +53,10 @@ public class DriftFileTest extends DriftDataAccessTest {
         executeInTransaction(new TransactionCallback() {
             @Override
             public void execute() {
-                JPADriftFileBits df2 = getEntityManager().find(JPADriftFileBits.class, df1.getHashId());
-                df2.setData(Hibernate.createBlob(toInputStream(newContent), newContent.length()));
+                EntityManager em = getEntityManager();
+                Session session = (Session) em.getDelegate();
+                JPADriftFileBits df2 = em.find(JPADriftFileBits.class, df1.getHashId());
+                df2.setData(session.getLobHelper().createBlob(toInputStream(newContent), newContent.length()));
                 getEntityManager().merge(df2);
             }
         });
@@ -87,7 +93,10 @@ public class DriftFileTest extends DriftDataAccessTest {
             final JPADriftFileBits driftFile = new JPADriftFileBits();
             driftFile.setDataSize(dataFile.length());
             driftFile.setHashId(digestGen.calcDigestString(dataFile));
-            driftFile.setData(Hibernate.createBlob(new BufferedInputStream(new FileInputStream(dataFile))));
+            EntityManager em = getEntityManager();
+            Session session = (Session) em.getDelegate();            
+            driftFile.setData(session.getLobHelper().createBlob(new BufferedInputStream(new FileInputStream(dataFile)),
+                dataFile.length()));
             dataFile.delete();
 
             executeInTransaction(new TransactionCallback() {
@@ -105,7 +114,8 @@ public class DriftFileTest extends DriftDataAccessTest {
             executeInTransaction(new TransactionCallback() {
                 @Override
                 public void execute() {
-                    JPADriftFileBits driftFileBits = getEntityManager().find(JPADriftFileBits.class, hashId);
+                    EntityManager em = getEntityManager();
+                    JPADriftFileBits driftFileBits = em.find(JPADriftFileBits.class, hashId);
                     blobs.add(driftFileBits.getBlob());
                     driftFiles.add(driftFileBits);
                 }
@@ -127,7 +137,10 @@ public class DriftFileTest extends DriftDataAccessTest {
             final JPADriftFileBits driftFile = new JPADriftFileBits();
             driftFile.setDataSize(dataFile.length());
             driftFile.setHashId(digestGen.calcDigestString(dataFile));
-            driftFile.setData(Hibernate.createBlob(new BufferedInputStream(new FileInputStream(dataFile))));
+            EntityManager em = getEntityManager();
+            Session session = (Session) em.getDelegate();
+            driftFile.setData(session.getLobHelper().createBlob(new BufferedInputStream(new FileInputStream(dataFile)),
+                dataFile.length()));
             dataFile.delete();
 
             try {
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/test/AbstractEJB3Test.java b/modules/core/domain/src/test/java/org/rhq/core/domain/test/AbstractEJB3Test.java
index 82af5e0..394defa 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/test/AbstractEJB3Test.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/test/AbstractEJB3Test.java
@@ -22,8 +22,13 @@
  */
 package org.rhq.core.domain.test;
 
+import static org.rhq.test.JPAUtils.lookupEntityManager;
+import static org.rhq.test.JPAUtils.lookupTransactionManager;
+
 import java.io.File;
 import java.net.URL;
+import java.sql.Connection;
+import java.sql.SQLException;
 import java.util.Date;
 import java.util.Hashtable;
 
@@ -32,6 +37,8 @@ import javax.naming.NamingException;
 import javax.persistence.EntityManager;
 import javax.transaction.TransactionManager;
 
+import org.hibernate.Session;
+import org.hibernate.jdbc.Work;
 import org.testng.AssertJUnit;
 import org.testng.annotations.AfterSuite;
 import org.testng.annotations.BeforeSuite;
@@ -42,9 +49,6 @@ import org.jboss.ejb3.embedded.EJB3StandaloneDeployer;
 import org.rhq.test.JPAUtils;
 import org.rhq.test.TransactionCallback;
 
-import static org.rhq.test.JPAUtils.lookupEntityManager;
-import static org.rhq.test.JPAUtils.lookupTransactionManager;
-
 public abstract class AbstractEJB3Test extends AssertJUnit {
 
     @BeforeSuite(groups = "integration.ejb3")
@@ -101,8 +105,24 @@ public abstract class AbstractEJB3Test extends AssertJUnit {
     }
 
     public boolean isPostgres(EntityManager em) throws Exception {
-        return ((org.hibernate.ejb.EntityManagerImpl) em).getSession().connection().getMetaData()
-            .getDatabaseProductName().toLowerCase().indexOf("postgres") > -1;
+        Session session = (Session) em.getDelegate();
+        ConnectionMetaData metaData = new ConnectionMetaData();
+        session.doWork(metaData);
+
+        return metaData.getDbProductName().indexOf("postgres") > -1;
+    }
+
+    private static class ConnectionMetaData implements Work {
+        private String dbProductName;
+
+        @Override
+        public void execute(Connection conn) throws SQLException {
+            dbProductName = conn.getMetaData().getDatabaseProductName().toLowerCase();
+        }
+
+        String getDbProductName() {
+            return dbProductName;
+        }
     }
 
     public InitialContext getInitialContext() {
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueryAllTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueryAllTest.java
index 754d331..5b30b26 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueryAllTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/test/QueryAllTest.java
@@ -36,7 +36,7 @@ import javax.persistence.Query;
 import javax.transaction.TransactionManager;
 
 import org.hibernate.Session;
-import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.engine.spi.SessionFactoryImplementor;
 import org.hibernate.metadata.ClassMetadata;
 import org.testng.annotations.Test;
 
diff --git a/modules/core/gui/pom.xml b/modules/core/gui/pom.xml
index 936df5e..69bfec8 100644
--- a/modules/core/gui/pom.xml
+++ b/modules/core/gui/pom.xml
@@ -28,34 +28,23 @@
 
       <dependency>
          <groupId>${rhq.groupId}</groupId>
-         <artifactId>rhq-core-client-api</artifactId>
+         <artifactId>rhq-core-util</artifactId>
          <version>${project.version}</version>
          <scope>provided</scope> <!-- by ${rhq.earName} -->
       </dependency>
 
       <dependency>
          <groupId>${rhq.groupId}</groupId>
-         <artifactId>rhq-core-domain</artifactId>
+         <artifactId>rhq-core-client-api</artifactId>
          <version>${project.version}</version>
-         <scope>provided</scope> <!-- by ${rhq.earName} (as ejb-jar) -->
+         <scope>provided</scope> <!-- by ${rhq.earName} -->
       </dependency>
 
       <dependency>
          <groupId>${rhq.groupId}</groupId>
-         <artifactId>rhq-core-util</artifactId>
+         <artifactId>rhq-core-domain</artifactId>
          <version>${project.version}</version>
-         <scope>provided</scope> <!-- by ${rhq.earName} -->
-      </dependency>
-
-      <!-- 3rd Party Deps -->
-
-      <!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
-      <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope>
-         <!-- by JBossAS -->
+         <scope>provided</scope> <!-- by ${rhq.earName} (as ejb-jar) -->
       </dependency>
 
       <dependency>
@@ -66,15 +55,6 @@
          <!-- by JBossAS -->
       </dependency>
 
-      <!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope>
-         <!-- by JBossAS -->
-      </dependency>
-
       <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
diff --git a/modules/core/gui/src/main/java/org/rhq/core/gui/util/FacesContextUtility.java b/modules/core/gui/src/main/java/org/rhq/core/gui/util/FacesContextUtility.java
index 7a2cafb..650f667 100644
--- a/modules/core/gui/src/main/java/org/rhq/core/gui/util/FacesContextUtility.java
+++ b/modules/core/gui/src/main/java/org/rhq/core/gui/util/FacesContextUtility.java
@@ -36,7 +36,6 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import org.jboss.seam.core.Manager;
-import org.jboss.seam.faces.FacesMessages;
 import org.jboss.seam.util.Strings;
 
 import org.rhq.core.util.exception.ThrowableUtil;
@@ -168,7 +167,7 @@ public abstract class FacesContextUtility {
             //Because the detail therefore must not be empty, we must resort to an ugly hack here and put in a unicode
             //for non-breakable space:
             String detailToUse = Strings.isEmpty(detail) ? "\u00a0" : detail;
-            FacesMessages.instance().add(toSeverity(severity), null, null, summary, detailToUse);
+            //FacesMessages.instance().add(toSeverity(severity), null, null, summary, detailToUse);
         } else {
             getFacesContext().addMessage(null, new FacesMessage(severity, summary, (detail != null) ? detail : ""));
         }
diff --git a/modules/core/plugin-api/pom.xml b/modules/core/plugin-api/pom.xml
index 5ba5465..049efd3 100644
--- a/modules/core/plugin-api/pom.xml
+++ b/modules/core/plugin-api/pom.xml
@@ -34,22 +34,6 @@
 
       <!-- 3rd Party Deps -->
 
-      <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-           available when compiling dependent classes. It is fixed in JDK 6 -->
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope>
-      </dependency>
-      <dependency>
-         <groupId>jboss.jboss-embeddable-ejb3</groupId>
-         <artifactId>hibernate-all</artifactId>
-         <version>1.0.0.Alpha9</version>
-         <scope>provided</scope> <!-- by ON Container -->
-         <!-- needed for referenced domain entities that use Hibernate annotations -->
-      </dependency>
-
       <dependency>
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
diff --git a/modules/core/plugin-container/pom.xml b/modules/core/plugin-container/pom.xml
index b9c19a4..a2ff73c 100644
--- a/modules/core/plugin-container/pom.xml
+++ b/modules/core/plugin-container/pom.xml
@@ -70,22 +70,6 @@
          <!--<scope>test</scope>  not sure about this -->
       </dependency>
 
-      <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-           available when compiling dependent classes. It is fixed in JDK 6 -->
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope>
-      </dependency>
-      <dependency>
-        <groupId>jboss.jboss-embeddable-ejb3</groupId>
-        <artifactId>hibernate-all</artifactId>
-        <version>1.0.0.Alpha9</version>
-        <scope>provided</scope> <!-- by ON Container -->
-        <!-- needed for referenced domain entities that use Hibernate annotations -->
-      </dependency>
-
       <dependency>
          <groupId>org.hyperic</groupId>
          <artifactId>sigar</artifactId>
diff --git a/modules/core/plugindoc/pom.xml b/modules/core/plugindoc/pom.xml
index c35c001..0f19a68 100644
--- a/modules/core/plugindoc/pom.xml
+++ b/modules/core/plugindoc/pom.xml
@@ -52,19 +52,6 @@
       </dependency>
 
       <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope>
-      </dependency>
-
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-      </dependency>
-
-      <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-plugin-api</artifactId>
          <version>2.0.8</version>
diff --git a/modules/enterprise/agent/pom.xml b/modules/enterprise/agent/pom.xml
index 892a1c0..7c1ce7d 100644
--- a/modules/enterprise/agent/pom.xml
+++ b/modules/enterprise/agent/pom.xml
@@ -90,29 +90,12 @@
       <artifactId>i18nlog</artifactId>
     </dependency>
 
-    <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-         available when compiling dependent classes. It is fixed in JDK 6 -->
-    <dependency>
-      <groupId>javax.persistence</groupId>
-      <artifactId>persistence-api</artifactId>
-      <version>1.0</version>
-      <scope>provided</scope>
-    </dependency>
-
     <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-remoting</artifactId>
       <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
     </dependency>
 
-    <dependency>
-      <groupId>jboss.jboss-embeddable-ejb3</groupId>
-      <artifactId>hibernate-all</artifactId>
-      <version>1.0.0.Alpha9</version>
-      <scope>provided</scope>
-      <!-- needed for referenced domain entities that use Hibernate annotations -->
-    </dependency>
-
   </dependencies>
 
   <build>
diff --git a/modules/enterprise/binding/pom.xml b/modules/enterprise/binding/pom.xml
index 51b5af7..04080cb 100644
--- a/modules/enterprise/binding/pom.xml
+++ b/modules/enterprise/binding/pom.xml
@@ -23,15 +23,23 @@
            <artifactId>rhq-scripting-api</artifactId>
            <version>${project.version}</version>
         </dependency>
+
+        <dependency>
+           <groupId>${project.groupId}</groupId>
+           <artifactId>rhq-core-util</artifactId>
+           <version>${project.version}</version>
+           <scope>provided</scope> <!-- by PC -->
+        </dependency>
         
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>rhq-core-domain</artifactId>
             <version>${project.version}</version>
+            <!-- I'm not sure this is still necessary due to hibernate now being provided scope in domain (jshaughn -->
             <exclusions>
                 <exclusion>
-                    <groupId>hibernate</groupId>
-                    <artifactId>hibernate3</artifactId>
+                    <groupId>org.hibernate</groupId>
+                    <artifactId>hibernate-entitymanager</artifactId>
                 </exclusion>
             </exclusions>
         </dependency>
@@ -162,6 +170,10 @@
                     <artifactId>jboss-serialization</artifactId>
                 </exclusion>
                 <exclusion>
+                    <groupId>antlr</groupId>
+                    <artifactId>antlr</artifactId>
+                </exclusion>                
+                <exclusion>
                     <groupId>org.antlr</groupId>
                     <artifactId>antlr</artifactId>
                 </exclusion>
@@ -184,21 +196,6 @@
         </dependency>
 
         <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>${persistence-api.version}</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>hibernate-annotations</groupId>
-            <artifactId>hibernate-annotations</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement 
-                section. -->
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
             <groupId>org.testng</groupId>
             <artifactId>testng</artifactId>
             <version>${testng.version}</version>
@@ -230,6 +227,12 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+           <groupId>org.hibernate.javax.persistence</groupId>
+           <artifactId>hibernate-jpa-2.0-api</artifactId>
+           <scope>test</scope>    
+      </dependency>
+
     </dependencies>
 
     <build>
diff --git a/modules/enterprise/gui/content_http-war/pom.xml b/modules/enterprise/gui/content_http-war/pom.xml
index 795ac54..93f93aa 100644
--- a/modules/enterprise/gui/content_http-war/pom.xml
+++ b/modules/enterprise/gui/content_http-war/pom.xml
@@ -48,36 +48,11 @@
 
         <!-- 3rd Party Deps -->
 
-        <dependency>
-            <groupId>hibernate</groupId>
-            <artifactId>hibernate3</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-            <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
         <!-- used by a test JSP -->
         <dependency>
-            <groupId>hibernate-entitymanager</groupId>
+            <groupId>org.hibernate</groupId>
             <artifactId>hibernate-entitymanager</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-            <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-        <!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
-        <dependency>
-            <groupId>hibernate-annotations</groupId>
-            <artifactId>hibernate-annotations</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-            <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-
-        <!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope> <!-- by JBossAS -->
+            <scope>provided</scope>
         </dependency>
         
         <!--
diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml
index 74cac97..5ebb0f9 100644
--- a/modules/enterprise/gui/coregui/pom.xml
+++ b/modules/enterprise/gui/coregui/pom.xml
@@ -81,31 +81,30 @@
 
         <!-- ============= Internal Deps ============= -->
 
+    <!-- by rhq.ear (as ejb-jar) -->
     <dependency>
       <groupId>org.rhq</groupId>
       <artifactId>rhq-core-domain</artifactId>
       <version>${project.version}</version>
       <scope>provided</scope>
-            <!-- by rhq.ear (as ejb-jar) -->
     </dependency>
 
+    <!-- by rhq.ear (as ejb-jar) -->
     <dependency>
       <groupId>org.rhq</groupId>
       <artifactId>rhq-enterprise-server</artifactId>
       <version>${project.version}</version>
-      <scope>provided</scope>
-            <!-- by rhq.ear (as ejb-jar) -->
+      <scope>provided</scope>    
     </dependency>
 
+    <!-- by rhq.ear -->
     <dependency>
       <groupId>org.rhq</groupId>
       <artifactId>rhq-core-util</artifactId>
       <version>${project.version}</version>
       <scope>provided</scope>
-            <!-- by rhq.ear -->
     </dependency>
 
-
         <!-- =============== 3rd Party Deps =============== -->
 
     <dependency>
@@ -177,15 +176,6 @@
             <!-- by JBossAS itself, which the container buildNodes has packaged with 1.6.5 -->
     </dependency>
 
-        <!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
-    <dependency>
-      <groupId>hibernate-annotations</groupId>
-      <artifactId>hibernate-annotations</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-      <scope>provided</scope>
-            <!-- by JBossAS -->
-    </dependency>
-
         <!-- transitive dependency needed for JspC -->
     <dependency>
       <groupId>javax.servlet</groupId>
@@ -195,31 +185,16 @@
             <!-- by JBossAS -->
     </dependency>
 
-        <!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
-    <dependency>
-      <groupId>javax.persistence</groupId>
-      <artifactId>persistence-api</artifactId>
-      <version>1.0</version>
-      <scope>provided</scope>
-            <!-- by JBossAS -->
-    </dependency>
-
-        <!-- needed for EJB3 annotations (e.g. ApplicationException) -->
     <dependency>
-      <groupId>jboss</groupId>
-      <artifactId>jboss-ejb3x</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-      <scope>provided</scope>
-            <!-- by JBossAS -->
+      <groupId>org.hibernate.javax.persistence</groupId>
+      <artifactId>hibernate-jpa-2.0-api</artifactId>
+      <scope>provided</scope>    
     </dependency>
 
-        <!-- Needed due to JDK 1.5 bug. -->
     <dependency>
-      <groupId>jboss</groupId>
-      <artifactId>jboss-annotations-ejb3</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-annotations</artifactId>
       <scope>provided</scope>
-            <!-- by JBossAS -->
     </dependency>
 
     <dependency>
diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml
index cd7fe4e..7b21a37 100644
--- a/modules/enterprise/gui/portal-war/pom.xml
+++ b/modules/enterprise/gui/portal-war/pom.xml
@@ -118,29 +118,14 @@
          <version>1.1.4</version>
       </dependency>
 
-      <dependency>
-         <groupId>hibernate</groupId>
-         <artifactId>hibernate3</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
       <!-- used by a test JSP -->
       <dependency>
-         <groupId>hibernate-entitymanager</groupId>
+         <groupId>org.hibernate</groupId>
          <artifactId>hibernate-entitymanager</artifactId>
          <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
          <scope>provided</scope> <!-- by JBossAS -->
       </dependency>
 
-      <!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
-      <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
       <dependency>
          <groupId>i18nlog</groupId>
          <artifactId>i18nlog</artifactId>
@@ -192,14 +177,6 @@
          <scope>provided</scope> <!-- by JBossAS -->
       </dependency>
 
-      <!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
       <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>jstl</artifactId>
@@ -237,14 +214,6 @@
          <scope>provided</scope> <!-- by JBossAS -->
       </dependency>
 
-      <!-- Needed due to JDK 1.5 bug. -->
-      <dependency>
-         <groupId>jboss</groupId>
-         <artifactId>jboss-annotations-ejb3</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
       <!-- used by DisplayTag_test.jsp -->
       <dependency>
          <groupId>junit</groupId>
@@ -352,12 +321,26 @@
          <groupId>struts</groupId>
          <artifactId>struts-el</artifactId>
          <version>1.2.9</version>
+         <exclusions>
+            <exclusion>
+               <groupId>antlr</groupId>
+               <artifactId>antlr</artifactId>
+               <!-- provided by JBossAS default config -->
+            </exclusion>
+         </exclusions>
       </dependency>
 
       <dependency>
          <groupId>struts-menu</groupId>
          <artifactId>struts-menu</artifactId>
          <version>2.3</version>
+         <exclusions>
+            <exclusion>
+               <groupId>antlr</groupId>
+               <artifactId>antlr</artifactId>
+               <!-- provided by JBossAS default config -->
+            </exclusion>
+         </exclusions>
       </dependency>
 
       <dependency>
diff --git a/modules/enterprise/gui/rest-war/pom.xml b/modules/enterprise/gui/rest-war/pom.xml
index abe1903..aab0638 100644
--- a/modules/enterprise/gui/rest-war/pom.xml
+++ b/modules/enterprise/gui/rest-war/pom.xml
@@ -57,32 +57,6 @@
            <scope>provided</scope> <!-- by JBossAS -->
         </dependency>
 
-        <!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
-        <dependency>
-           <groupId>javax.persistence</groupId>
-           <artifactId>persistence-api</artifactId>
-           <version>1.0</version>
-           <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-
-        <!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
-        <dependency>
-           <groupId>hibernate-annotations</groupId>
-           <artifactId>hibernate-annotations</artifactId>
-           <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-           <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-        <!-- Needed due to JDK 1.5 bug. -->
-        <dependency>
-           <groupId>jboss</groupId>
-           <artifactId>jboss-annotations-ejb3</artifactId>
-           <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-           <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-
     </dependencies>
     <build>
         <finalName>rhq-rest</finalName>
diff --git a/modules/enterprise/remoting/cli/pom.xml b/modules/enterprise/remoting/cli/pom.xml
index e2e07cb..adc27a1 100644
--- a/modules/enterprise/remoting/cli/pom.xml
+++ b/modules/enterprise/remoting/cli/pom.xml
@@ -13,13 +13,7 @@
 
    <name>RHQ Enterprise Remote CLI</name>
    <description>RHQ Enterprise Remote Command Line Interface</description>
-
-   <properties>
-      <persistence-api.version>1.0</persistence-api.version>
-      <hibernate-all.version>1.0.0.Alpha9</hibernate-all.version>
-      <opencsv.version>1.8</opencsv.version>
-   </properties>
-
+ 
    <dependencies>
       <dependency>
          <groupId>${project.groupId}</groupId>
diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml
index a87907e..425467a 100644
--- a/modules/enterprise/remoting/client-api/pom.xml
+++ b/modules/enterprise/remoting/client-api/pom.xml
@@ -13,12 +13,7 @@
 
    <name>RHQ Enterprise Remote Client API</name>
    <description>a set of client APIs used to connect to an RHQ Server and invoke methods on it</description>
-
-   <properties>
-      <persistence-api.version>1.0</persistence-api.version>
-      <hibernate-all.version>1.0.0.Alpha9</hibernate-all.version>
-   </properties>
-
+ 
    <dependencies>
 
       <dependency>
@@ -86,29 +81,12 @@
           <groupId>javassist</groupId>
           <artifactId>javassist</artifactId>
        </dependency>
-
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>${persistence-api.version}</version>
-         <exclusions>
-            <exclusion>
-              <groupId>hibernate-annotations</groupId>
-              <artifactId>hibernate-annotations</artifactId>
-            </exclusion>
-         </exclusions>
-      </dependency>
-
+ 
       <dependency>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
       </dependency>
 
-      <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-      </dependency>
-
    </dependencies>
 
    <profiles>
diff --git a/modules/enterprise/remoting/client-deps/pom.xml b/modules/enterprise/remoting/client-deps/pom.xml
index b8863d3..6d3ab5f 100644
--- a/modules/enterprise/remoting/client-deps/pom.xml
+++ b/modules/enterprise/remoting/client-deps/pom.xml
@@ -27,7 +27,11 @@
 	     <groupId>javax.xml.bind</groupId>
 	     <artifactId>jaxb-api</artifactId>
 	   </exclusion>
-           <exclusion>
+       <exclusion>
+         <groupId>antlr</groupId>
+         <artifactId>antlr</artifactId>
+       </exclusion>                	   
+       <exclusion>
 	     <groupId>org.antlr</groupId>
 	     <artifactId>antlr</artifactId>
 	   </exclusion>
diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml
index c6fedfc..f59c1ea 100644
--- a/modules/enterprise/server/container/pom.xml
+++ b/modules/enterprise/server/container/pom.xml
@@ -167,7 +167,7 @@
                   <property name="jtds.version" value="${jtds.version}" />
                   <property name="jsf-api.version" value="${jsf-api.version}" />
                   <property name="jsf-impl.version" value="${jsf-impl.version}" />
-                  <property name="hibernate3.version" value="${hibernate3.version}" />
+                  <property name="hibernate.version" value="${hibernate.version}" />
                   <property name="quartz.version" value="${quartz.version}" />
                   <property name="xercesImpl.version" value="${xercesImpl.version}" />
 
diff --git a/modules/enterprise/server/itests/pom.xml b/modules/enterprise/server/itests/pom.xml
index 43a14c8..379b29d 100644
--- a/modules/enterprise/server/itests/pom.xml
+++ b/modules/enterprise/server/itests/pom.xml
@@ -176,52 +176,18 @@
       </dependency>
 
       <dependency>
-         <groupId>hibernate</groupId>
-         <artifactId>hibernate3</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
-      <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
-      <dependency>
-         <groupId>hibernate-entitymanager</groupId>
-         <artifactId>hibernate-entitymanager</artifactId>
-         <scope>provided</scope>
-      </dependency>
-
-      <dependency>
         <groupId>javax.mail</groupId>
         <artifactId>mail</artifactId>
         <version>1.4</version>
       </dependency>
 
       <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
-      <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <version>2.4</version>
          <scope>provided</scope> <!-- by JBossAS -->
       </dependency>
 
-      <dependency>
-         <groupId>jboss</groupId>
-         <artifactId>jboss-annotations-ejb3</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
       <!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed by the PoolClass annotation used on some
            of our SLSB's -->
       <dependency>
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index 52eb316..f448206 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -156,13 +156,6 @@
       <!-- NOTE: The remaining test deps correspond to the classes contained in hibernate-all.jar and thirdparty-all.jar. -->
 
     <dependency>
-      <groupId>antlr</groupId>
-      <artifactId>antlr</artifactId>
-      <version>2.7.7</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
       <groupId>javassist</groupId>
       <artifactId>javassist</artifactId>
          <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
@@ -200,10 +193,27 @@
 
       <!-- 3rd Party Deps -->
 
+    <!-- do we really need this version, for now use the version provided by AS7, declare just below --> 
     <dependency>
       <groupId>org.antlr</groupId>
-      <artifactId>antlr</artifactId>
-      <version>3.2</version>
+      <artifactId>antlr-runtime</artifactId>
+      <version>3.2</version>  
+      <exclusions>
+        <exclusion>
+          <groupId>antlr</groupId>
+          <artifactId>antlr</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.antlr</groupId>
+          <artifactId>antlr</artifactId>
+        </exclusion>        
+      </exclusions>      
+    </dependency>    
+
+    <dependency>
+      <groupId>antlr</groupId>
+      <artifactId>antlr</artifactId>  
+      <scope>provided</scope>
     </dependency>
 
       <!-- Required by a couple APL and Lather classes - TODO: Remove this once APL and Lather have been excised. -->
@@ -255,24 +265,9 @@
     </dependency>
 
     <dependency>
-      <groupId>hibernate</groupId>
-      <artifactId>hibernate3</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-      <scope>provided</scope> <!-- by JBossAS -->
-    </dependency>
-
-    <dependency>
-      <groupId>hibernate-annotations</groupId>
-      <artifactId>hibernate-annotations</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-      <scope>provided</scope> <!-- by JBossAS -->
-    </dependency>
-
-    <dependency>
-      <groupId>hibernate-entitymanager</groupId>
+      <groupId>org.hibernate</groupId>
       <artifactId>hibernate-entitymanager</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-      <scope>provided</scope> <!-- by JBossAS -->
+      <scope>provided</scope>
     </dependency>
 
     <dependency>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
index c985c1e..5d149a1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/drift/JPADriftServerBean.java
@@ -46,7 +46,7 @@ import javax.persistence.Query;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.hibernate.Hibernate;
+import org.hibernate.Session;
 
 import org.rhq.common.drift.ChangeSetReader;
 import org.rhq.common.drift.ChangeSetReaderImpl;
@@ -296,14 +296,15 @@ public class JPADriftServerBean implements JPADriftServerLocal {
         if (null == df) {
             throw new IllegalArgumentException("JPADriftFile not found [" + driftFile.getHashId() + "]");
         }
+        Session session = (Session)entityManager.getDelegate();
         df.setDataSize(numBytes);
-        df.setData(Hibernate.createBlob(new BufferedInputStream(data)));
+        df.setData(session.getLobHelper().createBlob(new BufferedInputStream(data), numBytes));
         df.setStatus(LOADED);
     }
 
     // This facade does not start, or participate in, a transaction so that it can execute its work
     // in two new transactions.  The first transaction ensures all new entities are committed to the
-    // database.  The second transaction can then safely ackknowledge that the changeset is persisted
+    // database.  The second transaction can then safely acknowledge that the changeset is persisted
     // and request drift file content, if necessary.
     @Override
     @TransactionAttribute(NOT_SUPPORTED)
diff --git a/modules/enterprise/server/plugins/alert-sms/pom.xml b/modules/enterprise/server/plugins/alert-sms/pom.xml
index 0d550db..9348ce1 100644
--- a/modules/enterprise/server/plugins/alert-sms/pom.xml
+++ b/modules/enterprise/server/plugins/alert-sms/pom.xml
@@ -27,26 +27,7 @@
              <artifactId>rhq-enterprise-server</artifactId>
              <version>${project.version}</version>
              <scope>provided</scope> <!-- by JBossAS -->
-         </dependency>
-
-         <!--
-             TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent classes.
-         -->
-         <dependency>
-             <groupId>javax.persistence</groupId>
-             <artifactId>persistence-api</artifactId>
-             <version>1.0</version>
-             <scope>provided</scope>
-         </dependency>
-
-         <dependency>
-             <groupId>jboss.jboss-embeddable-ejb3</groupId>
-             <artifactId>hibernate-all</artifactId>
-             <version>1.0.0.Alpha9</version>
-             <scope>provided</scope>
-             <!-- needed for referenced domain entities that use Hibernate annotations -->
-         </dependency>
-
+         </dependency>         
 
          <dependency>
              <groupId>org.jboss.resteasy</groupId>
diff --git a/modules/enterprise/server/plugins/ant-bundle/pom.xml b/modules/enterprise/server/plugins/ant-bundle/pom.xml
index 3ef990a..e782c23 100644
--- a/modules/enterprise/server/plugins/ant-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/ant-bundle/pom.xml
@@ -39,23 +39,6 @@
 
         <!-- 3rd Party Deps -->
 
-        <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-         available when compiling dependent classes. It is fixed in JDK 6 -->
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>jboss.jboss-embeddable-ejb3</groupId>
-            <artifactId>hibernate-all</artifactId>
-            <version>1.0.0.Alpha9</version>
-            <scope>provided</scope>
-            <!-- needed for referenced domain entities that use Hibernate annotations -->
-        </dependency>
-
     </dependencies>
 
     <build>
diff --git a/modules/enterprise/server/plugins/drift-rhq/pom.xml b/modules/enterprise/server/plugins/drift-rhq/pom.xml
index 4c7b8a5..23fd88f 100644
--- a/modules/enterprise/server/plugins/drift-rhq/pom.xml
+++ b/modules/enterprise/server/plugins/drift-rhq/pom.xml
@@ -33,25 +33,6 @@
             <scope>provided</scope>
         </dependency>
 
-        <!-- 3rd Party Deps -->
-
-        <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-         available when compiling dependent classes. It is fixed in JDK 6 -->
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>jboss.jboss-embeddable-ejb3</groupId>
-            <artifactId>hibernate-all</artifactId>
-            <version>1.0.0.Alpha9</version>
-            <scope>provided</scope>
-            <!-- needed for referenced domain entities that use Hibernate annotations -->
-        </dependency>
-
     </dependencies>
 
     <build>
diff --git a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
index 873d66f..e05612b 100644
--- a/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
+++ b/modules/enterprise/server/plugins/filetemplate-bundle/pom.xml
@@ -39,25 +39,6 @@
             <version>${project.version}</version>
         </dependency>
 
-        <!-- 3rd Party Deps -->
-
-        <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-         available when compiling dependent classes. It is fixed in JDK 6 -->
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>jboss.jboss-embeddable-ejb3</groupId>
-            <artifactId>hibernate-all</artifactId>
-            <version>1.0.0.Alpha9</version>
-            <scope>provided</scope>
-            <!-- needed for referenced domain entities that use Hibernate annotations -->
-        </dependency>
-
     </dependencies>
 
     <build>
diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml
index 11f3b5c..c1b2ffe 100644
--- a/modules/enterprise/server/plugins/pom.xml
+++ b/modules/enterprise/server/plugins/pom.xml
@@ -32,25 +32,7 @@
          <version>${project.version}</version>
          <type>ejb</type>
       </dependency>
-
-      <!--
-         TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent classes.
-         It is fixed in JDK 6
-      -->
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope>
-      </dependency>
-
-      <dependency>
-         <groupId>jboss.jboss-embeddable-ejb3</groupId>
-         <artifactId>hibernate-all</artifactId>
-         <version>1.0.0.Alpha9</version>
-         <scope>provided</scope>
-         <!-- needed for referenced domain entities that use Hibernate annotations -->
-      </dependency>
+      
    </dependencies>
   <modules>
     <module>disk</module>
diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml
index f1cccf2..71775f9 100644
--- a/modules/enterprise/server/safe-invoker/pom.xml
+++ b/modules/enterprise/server/safe-invoker/pom.xml
@@ -17,14 +17,13 @@
    <description>TODO: Remove this invoker and move HibernateDetachUtility</description>
 
    <dependencies>
-
+ 
       <dependency>
-         <groupId>hibernate</groupId>
-         <artifactId>hibernate3</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-core</artifactId>    
+         <scope>provided</scope>
       </dependency>
-
+ 
    </dependencies>
 
   <profiles>
diff --git a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
index 08c02e2..c012d90 100644
--- a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
+++ b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/HibernateDetachUtility.java
@@ -471,10 +471,10 @@ public class HibernateDetachUtility {
                 }
 
             } else {
-                if (fieldValue instanceof org.hibernate.collection.PersistentCollection) {
+                if (fieldValue instanceof org.hibernate.collection.spi.PersistentCollection) {
                     // Replace hibernate specific collection types
 
-                    if (!((org.hibernate.collection.PersistentCollection) fieldValue).wasInitialized()) {
+                    if (!((org.hibernate.collection.spi.PersistentCollection) fieldValue).wasInitialized()) {
                         field.set(object, null);
                     } else {
 
diff --git a/modules/enterprise/server/xml-schemas/pom.xml b/modules/enterprise/server/xml-schemas/pom.xml
index 8fce608..d034e2d 100644
--- a/modules/enterprise/server/xml-schemas/pom.xml
+++ b/modules/enterprise/server/xml-schemas/pom.xml
@@ -44,17 +44,6 @@
             <!--<scope>test</scope>  not sure about this -->
     </dependency>
 
-        <!--
-            TODO: This is a fix for the Javac bug requiring annotations to be available when compiling dependent
-            classes; it is fixed in JDK 6.
-        -->
-    <dependency>
-      <groupId>jboss.jboss-embeddable-ejb3</groupId>
-      <artifactId>hibernate-all</artifactId>
-      <version>1.0.0.Alpha9</version>
-      <scope>provided</scope>
-    </dependency>
-
   </dependencies>
 
   <build>
diff --git a/modules/helpers/inventory-serializer/pom.xml b/modules/helpers/inventory-serializer/pom.xml
index ed18040..0d2cbae 100644
--- a/modules/helpers/inventory-serializer/pom.xml
+++ b/modules/helpers/inventory-serializer/pom.xml
@@ -13,32 +13,10 @@
 
     <dependencies>
         <dependency>
-            <groupId>hibernate-entitymanager</groupId>
-            <artifactId>hibernate-entitymanager</artifactId>
-            <version>${hibernate-entitymanager.version}</version>
-        </dependency>
-        <dependency>
             <groupId>gnu-getopt</groupId>
             <artifactId>getopt</artifactId>
         </dependency>
         <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>hibernate</groupId>
-            <artifactId>hibernate3</artifactId>
-            <version>${hibernate3.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>hibernate-annotations</groupId>
-            <artifactId>hibernate-annotations</artifactId>
-            <version>${hibernate-annotations.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
             <groupId>jboss</groupId>
             <artifactId>jboss-archive-browsing</artifactId>
             <version>5.0.0alpha-200607201-119</version>
diff --git a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
index 4351b11..4db1540 100644
--- a/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
+++ b/modules/integration-tests/jndi-access/jndi-access-test/pom.xml
@@ -158,48 +158,11 @@
         </dependency>
 
         <dependency>
-            <groupId>hibernate</groupId>
-            <artifactId>hibernate3</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement 
-                section. -->
-            <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-        <dependency>
-            <groupId>hibernate-annotations</groupId>
-            <artifactId>hibernate-annotations</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement 
-                section. -->
-            <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-        <dependency>
-            <groupId>hibernate-entitymanager</groupId>
-            <artifactId>hibernate-entitymanager</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
             <groupId>javax.mail</groupId>
             <artifactId>mail</artifactId>
             <version>1.4</version>
         </dependency>
 
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
-        <dependency>
-            <groupId>jboss</groupId>
-            <artifactId>jboss-annotations-ejb3</artifactId>
-            <!-- NOTE: The version is defined in the root POM's dependencyManagement 
-                section. -->
-            <scope>provided</scope> <!-- by JBossAS -->
-        </dependency>
-
         <!-- includes the org.jboss.ejb3.StrictMaxPool class, which is needed 
             by the PoolClass annotation used on some of our SLSB's -->
         <dependency>
diff --git a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
index dbeec8f..ec95c4d 100644
--- a/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
+++ b/modules/jopr/tools/jbas5-plugin-descriptor-gen/pom.xml
@@ -63,21 +63,6 @@
 		  <version>${project.version}</version>          
 		</dependency>
 
-      <dependency>
-         <groupId>javax.persistence</groupId>
-         <artifactId>persistence-api</artifactId>
-         <version>1.0</version>
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
-      <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-         <!-- NOTE: The version is defined in the root POM's dependencyManagemen
-t section. -->
-         <scope>provided</scope> <!-- by JBossAS -->
-      </dependency>
-
         <dependency>
           <groupId>commons-logging</groupId>
           <artifactId>commons-logging</artifactId>
diff --git a/modules/plugins/jboss-as-5/testsuite/pom.xml b/modules/plugins/jboss-as-5/testsuite/pom.xml
index e5e30f5..dd1949e 100644
--- a/modules/plugins/jboss-as-5/testsuite/pom.xml
+++ b/modules/plugins/jboss-as-5/testsuite/pom.xml
@@ -129,26 +129,6 @@ to load. Cactus will still run without this JAR.     jdobies, Feb 16, 2007. -->
             </exclusions>
         </dependency>
 
-        <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-available when compiling dependent classes. It is fixed in JDK 6. -->
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>persistence-api</artifactId>
-            <version>1.0</version>
-            <scope>provided</scope>
-            <!-- by ON container -->
-        </dependency>
-
-        <!-- TODO: This is a fix for the Javac bug requiring annotations to be
-available when compiling dependent classes; it is fixed in JDK 6. -->
-        <dependency>
-            <groupId>jboss.jboss-embeddable-ejb3</groupId>
-            <artifactId>hibernate-all</artifactId>
-            <version>1.0.0.Alpha9</version>
-            <scope>provided</scope>
-            <!-- by ON container -->
-        </dependency>
-
     </dependencies>
 
     <build>
diff --git a/pom.xml b/pom.xml
index eedd32b..e45231f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,9 +76,9 @@
     <concurrent.version>1.3.4-jboss-update1</concurrent.version> <!-- oswego-concurrent compatible with 4.2.3.GA -->
     <findbugs.version>2.3.2</findbugs.version>
     <getopt.version>1.0.13</getopt.version>
-    <hibernate3.version>3.2.r14201-2</hibernate3.version>
-    <hibernate-annotations.version>3.2.1.GA</hibernate-annotations.version>
-    <hibernate-entitymanager.version>3.2.1.GA</hibernate-entitymanager.version>
+    <hibernate.version>4.0.1.Final</hibernate.version>
+    <hibernate-annotations.version>3.5.6-Final</hibernate-annotations.version>
+    <hibernate-jpa-2.0-api.version>1.0.1.Final</hibernate-jpa-2.0-api.version>
     <i18nlog.version>1.0.10</i18nlog.version>
     <jaxb-api.version>2.1</jaxb-api.version>
     <jaxb-impl.version>2.1.9</jaxb-impl.version>
@@ -112,6 +112,7 @@
     <arquillian.version>1.0.1.Final</arquillian.version>
     <animal.sniffer.version>1.7</animal.sniffer.version>
     <xercesImpl.version>2.9.1-jbossas-2</xercesImpl.version> <!-- see BZ-820629 and CVE-2009-2625 -->
+    <antlr.version>2.7.7</antlr.version>
 
     <rhq.db.admin.username>rhqadmin</rhq.db.admin.username>
     <rhq.db.admin.password>rhqadmin</rhq.db.admin.password>
@@ -350,21 +351,33 @@
       </dependency>
 
       <dependency>
-        <groupId>hibernate</groupId>
-        <artifactId>hibernate3</artifactId>
-        <version>${hibernate3.version}</version>
+         <groupId>org.hibernate</groupId>
+         <artifactId>hibernate-annotations</artifactId>
+         <version>${hibernate-annotations.version}</version>
       </dependency>
 
       <dependency>
-         <groupId>hibernate-annotations</groupId>
-         <artifactId>hibernate-annotations</artifactId>
-         <version>${hibernate-annotations.version}</version>
+        <groupId>org.hibernate</groupId>
+        <artifactId>hibernate-core</artifactId>
+        <version>${hibernate.version}</version>
       </dependency>
 
       <dependency>
-         <groupId>hibernate-entitymanager</groupId>
+         <groupId>org.hibernate</groupId>
          <artifactId>hibernate-entitymanager</artifactId>
-         <version>${hibernate-entitymanager.version}</version>
+         <version>${hibernate.version}</version>
+      </dependency>
+
+      <dependency>
+         <groupId>org.hibernate.javax.persistence</groupId>
+         <artifactId>hibernate-jpa-2.0-api</artifactId>
+         <version>${hibernate-jpa-2.0-api.version}</version>
+      </dependency>
+
+      <dependency>
+         <groupId>antlr</groupId>
+         <artifactId>antlr</artifactId>
+         <version>${antlr.version}</version>
       </dependency>
 
       <dependency>
@@ -509,21 +522,6 @@
       <scope>provided</scope>
     </dependency>
 
-    <!-- TODO: This is a workaround for the Javac bug requiring annotations to be
-               available when compiling dependent classes. It is fixed in JDK 7. -->
-    <!-- JPA annotations -->
-    <dependency>
-       <groupId>javax.persistence</groupId>
-       <artifactId>persistence-api</artifactId>
-       <version>1.0</version>
-       <scope>provided</scope>
-    </dependency>
-    <!-- Hibernate annotations -->
-    <dependency>
-       <groupId>hibernate-annotations</groupId>
-       <artifactId>hibernate-annotations</artifactId>
-       <scope>provided</scope>
-    </dependency>
     <!-- JAXB annotations -->
     <dependency>
        <groupId>javax.xml.bind</groupId>




More information about the rhq-commits mailing list