Return-Path: Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: (qmail 27333 invoked from network); 25 Jan 2011 19:47:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Jan 2011 19:47:55 -0000 Received: (qmail 20247 invoked by uid 500); 25 Jan 2011 19:47:54 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 20140 invoked by uid 500); 25 Jan 2011 19:47:54 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 20132 invoked by uid 99); 25 Jan 2011 19:47:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jan 2011 19:47:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of heavy@ungoverned.org designates 69.89.21.8 as permitted sender) Received: from [69.89.21.8] (HELO oproxy3-pub.bluehost.com) (69.89.21.8) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 25 Jan 2011 19:47:46 +0000 Received: (qmail 22270 invoked by uid 0); 25 Jan 2011 19:47:25 -0000 Received: from unknown (HELO host118.hostmonster.com) (74.220.207.118) by oproxy3.bluehost.com with SMTP; 25 Jan 2011 19:47:25 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=ungoverned.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=Bcfoba6UPDR4255rxOhzB+uKMnk2gI0Ghnb1l+23xpj8twbOd8kEGo7dJfIC6rV9etWxGS2vs9qxEFL5PINKzLlvwLQaM5Q7hhKgbbguy9jtXqulfz7Z95nPcpsn//Ze; Received: from 97-84-148-211.dhcp.bycy.mi.charter.com ([97.84.148.211] helo=heavyweight.local) by host118.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1PhorN-0005WR-HQ for users@felix.apache.org; Tue, 25 Jan 2011 12:47:25 -0700 Message-ID: <4D3F28CB.9030900@ungoverned.org> Date: Tue, 25 Jan 2011 14:47:23 -0500 From: "Richard S. Hall" User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: users@felix.apache.org Subject: Re: bundle.update becomes ineffective after loading class via class loader References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {1027:host118.hostmonster.com:ungovern:ungoverned.org} {sentby:smtp auth 97.84.148.211 authed with heavy@ungoverned.org} On 1/25/11 14:17, Reto Bachmann-Gmuer wrote: > Hello > > When I attempt to load a class with > this.getClass.getClassLoader.load("foo.Hello") this prevents future updates > of the bundle exporting foo from being effective, services in that package > will not be running with the updated class until felix is restarted or > packageAdmin.refreshPackages called. > > Is this a known problem? This is not a "problem", that's how the spec defines it. If an exported package is being used by some bundle, then an update to the exported bundle does not take effect until it is refreshed. This allows you to do multiple updates without having to refresh dependent bundles multiple times. -> richard > > Example clerezza cosnole transcript > > zz>val b = bundleContext.getBundle(165) > b: org.osgi.framework.Bundle = tmp.foor [165] > zz>import java.io._ > import java.io._ > zz>b.update(new FileInputStream("/tmp/last2.jar")) > --> component changed version (looking at webpage generated by the jaxrs > service foo.Service) > > zz>b.update(new FileInputStream("/tmp/last1.jar")) > --> component changed version > > zz>val cl = this.getClass.getClassLoader() > cl: java.lang.ClassLoader = > scala.tools.nsc.interpreter.AbstractFileClassLoader@748a57a3 > zz>cl.loadClass("foo.Hello") > java.lang.ClassNotFoundException: foo.Hello > at > scala.tools.nsc.interpreter.AbstractFileClassLoader.onull$1(AbstractFileClassLoader.scala:21) > at > scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$getBytesForClass$1.apply(AbstractFileClassLoader.scala:26) > at > scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$getBytesForClass$1.apply(AbstractFileClassLoader.scala:25) > at > scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61) > at scala.collection.immutable.List.foreach(List.scala:45) > at > scala.tools.nsc.interpreter.AbstractFileClassLoader.getBytesForClass(AbstractFileClassLoader.scala:25) > at > scala.tools.nsc.interpreter.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:33) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > ... > zz>b.update(new FileInputStream("/tmp/last2.jar")) > --> no effect on component > > > Cheers, > reto > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org