You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2018/05/26 12:05:00 UTC

[jira] [Assigned] (WICKET-6551) LazyInitProxyFactory doesn't work correctly at Weblogic

     [ https://issues.apache.org/jira/browse/WICKET-6551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-6551:
---------------------------------------

    Assignee: Martin Grigorov

> 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)