Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 13247 invoked from network); 7 Jul 2010 09:00:21 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Jul 2010 09:00:21 -0000 Received: (qmail 71896 invoked by uid 500); 7 Jul 2010 09:00:20 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 71406 invoked by uid 500); 7 Jul 2010 09:00:17 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 71361 invoked by uid 99); 7 Jul 2010 09:00:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 09:00:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 09:00:12 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o678xppg028999 for ; Wed, 7 Jul 2010 08:59:51 GMT Message-ID: <10131269.236681278493191320.JavaMail.jira@thor> Date: Wed, 7 Jul 2010 04:59:51 -0400 (EDT) From: "Sven Ludwig (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (LANG-626) object cloning with SerializationUtils has classloader problems with no workaround In-Reply-To: <4000508.84461276890923347.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sven Ludwig updated LANG-626: ----------------------------- Attachment: ContextClassLoaderAwareCloneMethod.zip Proposal of additional method for the SerializationUtils that works with the current thread context ClassLoader. Fixes the problem under Tomcat. > object cloning with SerializationUtils has classloader problems with no workaround > ---------------------------------------------------------------------------------- > > Key: LANG-626 > URL: https://issues.apache.org/jira/browse/LANG-626 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Environment: WebLogic 10.3 > Reporter: Ernest Pasour > Attachments: ContextClassLoaderAwareCloneMethod.zip > > > 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 clients. > http://www.mail-archive.com/commons-dev@jakarta.apache.org/msg44524.html > 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. > https://issues.apache.org/jira/browse/OJB-140 > https://issues.apache.org/jira/browse/LANG-241 > https://issues.apache.org/jira/browse/JS2-831 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.