[ 
https://issues.apache.org/jira/browse/WICKET-6551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491632#comment-16491632
 ] 

ASF subversion and git services commented on WICKET-6551:
---------------------------------------------------------

Commit 7b46091afacf5f29ca8e54b908d64f42f16a0fe6 in wicket's branch 
refs/heads/wicket-7.x from [~mgrigorov]
[ https://git-wip-us.apache.org/repos/asf?p=wicket.git;h=7b46091 ]

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)


> LazyInitProxyFactory doesn't work correctly at Weblogic
> -------------------------------------------------------
>
>                 Key: WICKET-6551
>                 URL: https://issues.apache.org/jira/browse/WICKET-6551
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-spring
>    Affects Versions: 6.21.0
>            Reporter: Tomas Kloucek
>            Assignee: Martin Grigorov
>            Priority: Critical
>
> When weblogic serializes HTTP session then it's not an Wicket Application 
> thread and Thread.currentThread().getClassLoader() can return different 
> NOT-application classloader... which ends in 
> LazyInitProxyFactory.readResolve() ClassNotFoundException crash...This ends 
> in Wicket's WebSession being not saved into HTTP session which is fatal 
> consequence....
> We have sucessfully tested following patch of LazyInitProxyFactory:
>  
> {code:java}
> static class ProxyReplacement implements IClusterable
>  {
>  private static final long serialVersionUID = 1L;
> private final IProxyTargetLocator locator;
> private final String type;
> /**
>  * Constructor
>  * 
>  * @param type
>  * @param locator
>  */
>  public ProxyReplacement(final String type, final IProxyTargetLocator 
> locator) \{ this.type = type; this.locator = locator; }
> private Object readResolve() throws ObjectStreamException
>  {
>  Class<?> clazz = WicketObjects.resolveClass(type);
>  if (clazz == null)
>  {
>  try
> { clazz = Class.forName(type, false, WicketObjects.class.getClassLoader()); 
> System.out.println("Clazz resolved through application classloade"); }
> catch (ClassNotFoundException e)
> { 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);
>  }
> }
> {code}
> With this patched LazyInitProxyFactory class problem went away. Can you 
> please accomodate this fix into Wicket 6.x line?
>  
> Forum link: 
> [http://apache-wicket.1842946.n4.nabble.com/Wicket-s-LazyInitProxyFactory-runs-incorrectly-at-WebLogic-td4680236.html]
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to