You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2007/05/02 23:34:02 UTC

svn commit: r534622 - /incubator/wicket/trunk/jdk-1.4/wicket-spring/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java

Author: ivaynberg
Date: Wed May  2 14:34:01 2007
New Revision: 534622

URL: http://svn.apache.org/viewvc?view=rev&rev=534622
Log:
WICKET-279

Modified:
    incubator/wicket/trunk/jdk-1.4/wicket-spring/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket-spring/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket-spring/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java?view=diff&rev=534622&r1=534621&r2=534622
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket-spring/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket-spring/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java Wed May  2 14:34:01 2007
@@ -120,9 +120,26 @@
 		{
 			JdkHandler handler = new JdkHandler(type, locator);
 
-			return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
-					new Class[] {type, Serializable.class, ILazyInitProxy.class,
-							IWriteReplace.class}, handler);
+			try
+			{
+				return Proxy.newProxyInstance(Thread.currentThread()
+						.getContextClassLoader(), new Class[] {type, Serializable.class,
+						ILazyInitProxy.class, IWriteReplace.class}, handler);
+			}
+			catch (IllegalArgumentException e)
+			{
+				/*
+				 * STW: In some clustering environments it appears the context
+				 * classloader fails to load the proxied interface (currently
+				 * seen in BEA WLS 9.x clusters). If this happens, we can try
+				 * and fall back to the classloader (current) that actually
+				 * loaded this class.
+				 */
+				return Proxy.newProxyInstance(
+						LazyInitProxyFactory.class.getClassLoader(), new Class[] {type,
+								Serializable.class, ILazyInitProxy.class,
+								IWriteReplace.class}, handler);
+			}
 
 		}
 		else