commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] [Resolved] (LANG-626) object cloning with SerializationUtils has classloader problems with no workaround
Date Tue, 02 Aug 2011 06:58:27 GMT


Henri Yandell resolved LANG-626.

    Resolution: Fixed

Thanks Sven :)

svn ci -m "Applying Sven Ludwig's patch from LANG-626. This modifies the SerializationUtils.clone
method to use the threadContextLoader if it is unable to find a class using the object's current
classloader. This should (hopefully) help with Weblogic and Tomcat situations where Lang is
outside the web-inf for some reason (likely user error with Tomcat, by design for Weblogic)"
Sending        pom.xml
Sending        src/main/java/org/apache/commons/lang3/
Transmitting file data ..
Committed revision 1153046.

> object cloning with SerializationUtils has classloader problems with no workaround
> ----------------------------------------------------------------------------------
>                 Key: LANG-626
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>         Environment: WebLogic 10.3
>            Reporter: Ernest Pasour
>             Fix For: 3.0.1
>         Attachments:,
> In WebLogic 10.3, commons_lang is included on the main classpath, trumping the commons_lang
on a webapp classpath (in webinf/lib).  This causes ClassNotFoundException errors when using
SerializationUtils.clone() because Java serialization uses the classloader of the current
class (class invoked from) when doing serialization.  Java serialization does not respond
to the thread context classloader.
> Fix: The following web page suggests a fix (including the full source code) that honors
the context classloader if set.  I don't know if this is the ideal solution, but at least
it allows the problem to be worked around without affecting working behavior for existing
> Workaround: There is a flag to set on weblogic that inverts the classloader.  *HOWEVER*,
this only works if the webapp does not need certain xml jars.   Otherwise, WebLogic will fail
to start because *it* has classloader issues.    Therefore, this is not an acceptable workaround.
> Another workaround: The only workaround I know of is to copy the SerializationUtils class
into a different package in my app so that the proper invocation context will be used for
serialization.  This is very undesirable.
> I found these 3 bugs in the database that all seem to be the same problem.  

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message