You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2014/02/08 15:05:52 UTC

git commit: Fixing the tapestry-hibernate-core test failures and updating the Hibernate configuratino file DTD.

Updated Branches:
  refs/heads/master 5b3d81aa9 -> fbdf1a70d


Fixing the tapestry-hibernate-core test failures and updating the Hibernate configuratino file DTD.


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/fbdf1a70
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/fbdf1a70
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/fbdf1a70

Branch: refs/heads/master
Commit: fbdf1a70dd0b934355d535d544c9ebe136d2d6f5
Parents: 5b3d81a
Author: Thiago H. de Paula Figueiredo <th...@apache.org>
Authored: Sat Feb 8 12:05:37 2014 -0200
Committer: Thiago H. de Paula Figueiredo <th...@apache.org>
Committed: Sat Feb 8 12:05:37 2014 -0200

----------------------------------------------------------------------
 .../internal/plastic/PlasticClassPool.java      | 26 +++++++++++++++-----
 .../src/test/resources/hibernate.cfg.xml        |  2 +-
 .../src/test/resources/hibernate.cfg.xml        |  2 +-
 3 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fbdf1a70/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassPool.java
----------------------------------------------------------------------
diff --git a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassPool.java b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassPool.java
index edf3840..ad9e096 100644
--- a/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassPool.java
+++ b/plastic/src/main/java/org/apache/tapestry5/internal/plastic/PlasticClassPool.java
@@ -19,6 +19,8 @@ import org.apache.tapestry5.internal.plastic.asm.ClassWriter;
 import org.apache.tapestry5.internal.plastic.asm.Opcodes;
 import org.apache.tapestry5.internal.plastic.asm.tree.*;
 import org.apache.tapestry5.plastic.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.BufferedInputStream;
 import java.io.IOException;
@@ -35,6 +37,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
 @SuppressWarnings("rawtypes")
 public class PlasticClassPool implements ClassLoaderDelegate, Opcodes, PlasticClassListenerHub
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(PlasticClassPool.class); 
+    
     final PlasticClassLoader loader;
 
     private final PlasticManagerDelegate delegate;
@@ -522,8 +526,22 @@ public class PlasticClassPool implements ClassLoaderDelegate, Opcodes, PlasticCl
                     implementationClassName = 
                             transformedClassNameToImplementationClassName.get(implementationClassName);
                 }
-                implementationClassNode = readClassNode(implementationClassName);
+                
+                if (!implementationClassName.startsWith("com.sun.proxy")) {
+                
+                    try {
+                        implementationClassNode = readClassNode(implementationClassName);
+                    }
+                    catch (IOException e) {
+                        LOGGER.warn(String.format("Unable to load class %s as the implementation of service %s", 
+                                implementationClassName, baseClassName));
+                        // Go on. Probably a proxy class
+                    }
+                    
+                }
+                
                 transformedClassNameToImplementationClassName.put(newClassName, implementationClassName);
+                
             }
 
             return createTransformation(baseClassName, newClassNode, implementationClassNode, true);
@@ -532,11 +550,7 @@ public class PlasticClassPool implements ClassLoaderDelegate, Opcodes, PlasticCl
             throw new RuntimeException(String.format("Unable to create class %s as sub-class of %s: %s", newClassName,
                     baseClassName, PlasticInternalUtils.toMessage(ex)), ex);
         }
-        catch (IOException e)
-        {
-            throw new RuntimeException(String.format("Unable to load class %s as the implementation of service %s", 
-                    implementationClassName, baseClassName), e);
-        }
+        
     }
 
     private ClassNode readClassNode(String className) throws IOException

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fbdf1a70/tapestry-hibernate-core/src/test/resources/hibernate.cfg.xml
----------------------------------------------------------------------
diff --git a/tapestry-hibernate-core/src/test/resources/hibernate.cfg.xml b/tapestry-hibernate-core/src/test/resources/hibernate.cfg.xml
index 91123c5..d02951b 100644
--- a/tapestry-hibernate-core/src/test/resources/hibernate.cfg.xml
+++ b/tapestry-hibernate-core/src/test/resources/hibernate.cfg.xml
@@ -17,7 +17,7 @@
 
 <!DOCTYPE hibernate-configuration PUBLIC
         "-//Hibernate/Hibernate Configuration DTD//EN"
-        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
 
 <hibernate-configuration>
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fbdf1a70/tapestry-hibernate/src/test/resources/hibernate.cfg.xml
----------------------------------------------------------------------
diff --git a/tapestry-hibernate/src/test/resources/hibernate.cfg.xml b/tapestry-hibernate/src/test/resources/hibernate.cfg.xml
index 103e2f7..08faacc 100644
--- a/tapestry-hibernate/src/test/resources/hibernate.cfg.xml
+++ b/tapestry-hibernate/src/test/resources/hibernate.cfg.xml
@@ -17,7 +17,7 @@
 
 <!DOCTYPE hibernate-configuration PUBLIC
     "-//Hibernate/Hibernate Configuration DTD//EN"
-    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
 
 <hibernate-configuration>