Repository: wicket
Updated Branches:
  refs/heads/wicket-8.x 899fe9466 -> efa51293d


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

(cherry picked from commit 6a7b097ff682e261608ebe58e8ca1f0c63f3b472)


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

Branch: refs/heads/wicket-8.x
Commit: efa51293df700bee3726571fb7cfef5c23c4fb41
Parents: 899fe94
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:20:38 2018 +0300

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


http://git-wip-us.apache.org/repos/asf/wicket/blob/efa51293/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 d3b1a4d..c3373cc 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
@@ -263,10 +263,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