tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1355986 - /openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
Date Sun, 01 Jul 2012 19:25:54 GMT
Author: rmannibucau
Date: Sun Jul  1 19:25:53 2012
New Revision: 1355986

URL: http://svn.apache.org/viewvc?rev=1355986&view=rev
Log:
TOMEE-261 TOMEE-262 checking hibernate integration class from current classloader since now
we add it to webapps automatically

Modified:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java?rev=1355986&r1=1355985&r2=1355986&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
Sun Jul  1 19:25:53 2012
@@ -632,11 +632,12 @@ class AppInfoBuilder {
                 // info.persistenceUnitRootUrl = null; // to avoid HHH015010
 
                 if (className == null || className.startsWith("org.hibernate.transaction")
|| className.startsWith("org.hibernate.service.jta.platform")){
+                    final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                     String key = HIBERNATE_JTA_PLATFORM;
                     String value = MakeTxLookup.HIBERNATE_NEW_FACTORY;
                     try {
                         // hibernate 4
-                        AppInfoBuilder.class.getClassLoader().loadClass("org.hibernate.service.jta.platform.spi.JtaPlatform");
+                        classLoader.loadClass("org.hibernate.service.jta.platform.spi.JtaPlatform");
                     } catch (Exception e) {
                         // hibernate 3. In the worse case it is set with a hibernate 4 and
hibernate will convert it.
                         key = HIBERNATE_TRANSACTION_MANAGER_LOOKUP_CLASS;
@@ -644,7 +645,7 @@ class AppInfoBuilder {
                     }
 
                     try {
-                        AppInfoBuilder.class.getClassLoader().loadClass(value);
+                        classLoader.loadClass(value);
                         info.properties.setProperty(key, value);
                         logger.debug("Adjusting PersistenceUnit(name=" + info.name + ") property
to " + key + "=" + value);
                     } catch (Exception e) {



Mime
View raw message