Repository: wicket Updated Branches: refs/heads/master dade0103a -> 4d4a69062
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/4d4a6906 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4d4a6906 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4d4a6906 Branch: refs/heads/master Commit: 4d4a69062dc34be29bf61a152b34d2dcf2b76a21 Parents: dade010 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:57 2018 +0300 ---------------------------------------------------------------------- .../wicket/proxy/LazyInitProxyFactory.java | 22 ++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/4d4a6906/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); }
