Return-Path: Delivered-To: apmail-incubator-abdera-user-archive@locus.apache.org Received: (qmail 64390 invoked from network); 11 Jul 2008 08:35:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jul 2008 08:35:04 -0000 Received: (qmail 6522 invoked by uid 500); 11 Jul 2008 08:35:04 -0000 Delivered-To: apmail-incubator-abdera-user-archive@incubator.apache.org Received: (qmail 6503 invoked by uid 500); 11 Jul 2008 08:35:04 -0000 Mailing-List: contact abdera-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-user@incubator.apache.org Delivered-To: mailing list abdera-user@incubator.apache.org Received: (qmail 6489 invoked by uid 99); 11 Jul 2008 08:35:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jul 2008 01:35:04 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sergio.bossa@gmail.com designates 64.233.166.183 as permitted sender) Received: from [64.233.166.183] (HELO py-out-1112.google.com) (64.233.166.183) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jul 2008 08:34:11 +0000 Received: by py-out-1112.google.com with SMTP id u52so2944043pyb.13 for ; Fri, 11 Jul 2008 01:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=y8rOg1N8MK/aHc6Eqv8YaOxZbTktaWGb/UBqqqqTFt8=; b=WdAWLlhHiZT9OxVpukkwVcvry0x7WpXpLr7OuFJUEFR9dd3QCriolOKLumRT2dfmD1 or2uNvDX2V+B2CTYdjck8FQlNdWd61btIiMp/glp3dj5ncn58A5Co0z7Pi9SOj+CIdo+ cwlGh+q2505RESbEx8tKzbOg0AC3bM6RBnSS0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=TTfbkBq5ncG4MMUNruoTjmp+XgPoSVkferEb/SPyVRyhsG9rO/71CGH03SDA0fTUiC bphs9kwOcorDk8pw+Fq2Fw4Ku81KHnnruSrS4j/TAzmvTfHXsoZ+y2u2eVZ9gtT1XQNb g+bZolRF3Wth6S6TPp/wTlvNmRuoTW98IcjYc= Received: by 10.115.16.14 with SMTP id t14mr8274488wai.55.1215765272137; Fri, 11 Jul 2008 01:34:32 -0700 (PDT) Received: by 10.141.36.9 with HTTP; Fri, 11 Jul 2008 01:34:32 -0700 (PDT) Message-ID: <806e13040807110134i49699b6bwf3e3643d36e6cc4e@mail.gmail.com> Date: Fri, 11 Jul 2008 10:34:32 +0200 From: "Sergio Bossa" To: abdera-user@incubator.apache.org Subject: Re: Classloader problems when creating Factory and Parser objects In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Jul 10, 2008 at 7:24 PM, Zeenat Lainwala wrote: > In my product, the abdera classes are packaged in an OSGI bundle. This is > version 0.4.0. When abdera creates a Factory, Parser, etc, it uses the > application classloader and the system class loader > (org.apache.abdera.util.ServiceUtil.java locateInstance) instead of using > the classloader from > the bundle. Since the Factory, Parser etc classes are in the bundle, the > classloading fails. Hi, you may try to overwrite the current thread classloader by calling the following method into your code: Thread.currentThread().setContextClassLoader(osgiClassloader). Let us know if it works. Cheers, Sergio B. -- Sergio Bossa Software Passionate, Java Technologies Specialist and Open Source Enthusiast. Blog : http://sbtourist.blogspot.com Sourcesense - making sense of Open Source : http://www.sourcesense.com Pro-netics s.p.a. : http://www.pronetics.it