Repository: wicket
Updated Branches:
  refs/heads/wicket-6.x c2bf22c1f -> 6a7b097ff


WICKET-6551 LazyInitProxyFactory doesn't work correctly at Weblogic

Try to load the class with the thread's context class loader and Wicket's 
classes loader as a fallbacks


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6a7b097f
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6a7b097f
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6a7b097f

Branch: refs/heads/wicket-6.x
Commit: 6a7b097ff682e261608ebe58e8ca1f0c63f3b472
Parents: c2bf22c
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Sat May 26 15:19:02 2018 +0300
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Sat May 26 15:19:02 2018 +0300

----------------------------------------------------------------------
 .../wicket/proxy/LazyInitProxyFactory.java      | 22 ++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/6a7b097f/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java
----------------------------------------------------------------------
diff --git 
a/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java 
b/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java
index ab4a0b2..c8604c4 100644
--- a/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java
+++ b/wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java
@@ -253,10 +253,24 @@ public class LazyInitProxyFactory
                        Class<?> clazz = WicketObjects.resolveClass(type);
                        if (clazz == null)
                        {
-                               ClassNotFoundException cause = new 
ClassNotFoundException(
-                                       "Could not resolve type [" + type +
-                                               "] with the currently 
configured org.apache.wicket.application.IClassResolver");
-                               throw new WicketRuntimeException(cause);
+                               try
+                               {
+                                       clazz = Class.forName(type, false, 
Thread.currentThread().getContextClassLoader());
+                               }
+                               catch (ClassNotFoundException ignored1)
+                               {
+                                       try
+                                       {
+                                               clazz = Class.forName(type, 
false, LazyInitProxyFactory.class.getClassLoader());
+                                       }
+                                       catch (ClassNotFoundException ignored2)
+                                       {
+                                               ClassNotFoundException cause = 
new ClassNotFoundException(
+                                                               "Could not 
resolve type [" + type +
+                                                                               
"] with the currently configured org.apache.wicket.application.IClassResolver");
+                                               throw new 
WicketRuntimeException(cause);
+                                       }
+                               }
                        }
                        return LazyInitProxyFactory.createProxy(clazz, locator);
                }

Reply via email to