Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 82893 invoked from network); 22 Apr 2010 08:07:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Apr 2010 08:07:33 -0000 Received: (qmail 66656 invoked by uid 500); 22 Apr 2010 08:07:33 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 66614 invoked by uid 500); 22 Apr 2010 08:07:33 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 66607 invoked by uid 99); 22 Apr 2010 08:07:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Apr 2010 08:07:33 +0000 X-ASF-Spam-Status: No, hits=-1329.8 required=10.0 tests=ALL_TRUSTED,AWL 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; Thu, 22 Apr 2010 08:07:32 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3M87CKj012564 for ; Thu, 22 Apr 2010 08:07:12 GMT Message-ID: <8604738.134221271923632531.JavaMail.jira@thor> Date: Thu, 22 Apr 2010 04:07:12 -0400 (EDT) From: "Pierre-Arnaud Marcelot (JIRA)" To: dev@directory.apache.org Subject: [jira] Closed: (DIRSTUDIO-585) Do not modify the current thread's ClassLoader; or reset it afterwards In-Reply-To: <1508679271.1257889527981.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRSTUDIO-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pierre-Arnaud Marcelot closed DIRSTUDIO-585. -------------------------------------------- Version 1.5.3 has been released. Let's close this issue. > Do not modify the current thread's ClassLoader; or reset it afterwards > ---------------------------------------------------------------------- > > Key: DIRSTUDIO-585 > URL: https://issues.apache.org/jira/browse/DIRSTUDIO-585 > Project: Directory Studio > Issue Type: Bug > Components: studio-ldapbrowser > Affects Versions: 1.4.0, 1.5.0 > Reporter: Karsten Baensch > Assignee: Stefan Seelmann > Fix For: 1.5.3 > > > Hi, > in BrowserConnectionManager.load > and in > Utils.serialize / deserialize > we recognized that the ClassLoader is modified without conserving / resetting it to the previous one at the end. > This conflicted with our class loading mechanisms ... streaming from our own class store. > As a quick fix for testing, we could do for example the following; however, this is not a real solution: > public static String serialize( Object o ) > { > String s = null; > Thread cur_thrd = Thread.currentThread(); //patch reset current class loader > ClassLoader cur_thrd_cl = cur_thrd.getContextClassLoader(); > try{ > cur_thrd.setContextClassLoader( Utils.class.getClassLoader() ); > ByteArrayOutputStream baos = new ByteArrayOutputStream(); > XMLEncoder encoder = new XMLEncoder( baos ); > encoder.writeObject( o ); > encoder.close(); > s = LdifUtils.utf8decode( baos.toByteArray() ); > }finally{ > cur_thrd.setContextClassLoader(cur_thrd_cl); > } > return s; > } > => Is there a better way? > Thanks and regards, > Karsten -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.