Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 02748F5F9 for ; Mon, 22 Apr 2013 13:50:17 +0000 (UTC) Received: (qmail 88843 invoked by uid 500); 22 Apr 2013 13:50:16 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 88802 invoked by uid 500); 22 Apr 2013 13:50:16 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 88791 invoked by uid 99); 22 Apr 2013 13:50:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 13:50:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bdekruijff@gmail.com designates 209.85.128.44 as permitted sender) Received: from [209.85.128.44] (HELO mail-qe0-f44.google.com) (209.85.128.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Apr 2013 13:50:09 +0000 Received: by mail-qe0-f44.google.com with SMTP id w7so689451qeb.17 for ; Mon, 22 Apr 2013 06:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=xyuNWAnfo1BwInIVmZBBubIoL/Vsk+1gnf0XdJkkf9o=; b=icIKuoSYn1kiaFYjqL1GqjYNE0lG+d6xSqIcm2EbR4OBeeyLzFps6DIcRkhbXFsBFg Auf1DUb3sXlelmgW76d9Nq98fJFjoKZHzzdpjnqD5DpYQHf1eAIe/q9y47DvDbHt0DpV fCifqBrW3uhq78Y9rR8EH7b530ho2WGWTTWxl6f1Y5QF8oR4pL671yR7F55rxq3QhmOq 5S3bpcsjCfPmUTJWYESRppyO+rjyZt4CbEfdLRJ6tY6bKMbh4ec062VLmFaQAZPNc6CT wWThd/W/OVRnVgOyLQu5G/SL3WRG3ngUiYNWFUwcrFDC9FFPYyJZkc3SQA/35+y+QJ8q Z/cw== MIME-Version: 1.0 X-Received: by 10.229.93.71 with SMTP id u7mr9164512qcm.44.1366638589025; Mon, 22 Apr 2013 06:49:49 -0700 (PDT) Received: by 10.49.13.98 with HTTP; Mon, 22 Apr 2013 06:49:48 -0700 (PDT) In-Reply-To: References: <006B43FB-D252-4410-A2B0-7423A07BD41D@yahoo.com> Date: Mon, 22 Apr 2013 15:49:48 +0200 Message-ID: Subject: Re: Config Admin problem and working around it or fixing it From: Bram de Kruijff To: dev@felix.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Apr 9, 2013 at 7:32 AM, Felix Meschberger wrot= e: > Hi > > If the trunk build fixes your problem, we should just relase configadmin.= WDYT ? > +1 As I quite persistently run into FELIX-3762 I would appreciate a release :) thanks Bram > Regards > Felix > > Am 07.04.2013 um 14:29 schrieb David Jencks: > >> I mentioned somewhere recently that my implementation of R5 features for= DS was stalled due to test failures running against released versions of F= elix config admin. I've identified the problem more closely and wonder wha= t to do. >> >> The config admin problem appears to be solved by FELIX-3820. Here's some= test code that reproduces it (I put this in the DS ComponentConfigurationP= ID test to run it) >> >> @Test >> public void testConfigAdminClosed() throws Exception >> { >> Bundle b =3D installBundle(); >> b.start(); >> BundleContext bc =3D b.getBundleContext(); >> ServiceReference ref =3D bc.getServiceReferen= ce( ConfigurationAdmin.class ); >> ConfigurationAdmin ca =3D bc.getService( ref ); >> Configuration conf =3D ca.getConfiguration( "foo.pid" ); >> bc.ungetService( ref ); >> String location =3D conf.getBundleLocation(); >> >> } >> >> protected Bundle installBundle( ) throws BundleException >> { >> final InputStream bundleStream =3D bundle() >> .set(Constants.BUNDLE_SYMBOLICNAME, "simplecomponent2") >> .set(Constants.BUNDLE_VERSION, "0.0.11") >> .build(withBnd()); >> >> try >> { >> final String location =3D "test:SimpleComponent/" + System.cu= rrentTimeMillis(); >> return bundleContext.installBundle( location, bundleStream ); >> } >> finally >> { >> try >> { >> bundleStream.close(); >> } >> catch ( IOException ioe ) >> { >> } >> } >> } >> >> >> The line >> String location =3D conf.getBundleLocation(); >> >> gives an NPE like this: >> >> java.lang.NullPointerE= xception >> at org.apache.felix.cm.impl.ConfigurationAdminImpl.hasPermission(C= onfigurationAdminImpl.java:156) >> at org.apache.felix.cm.impl.ConfigurationAdminImpl.checkPermission= (ConfigurationAdminImpl.java:170) >> at org.apache.felix.cm.impl.ConfigurationAdapter.getBundleLocation= (ConfigurationAdapter.java:73) >> at org.apache.felix.scr.integration.ComponentConfigurationPidTest.= testConfigAdmingClosed(ComponentConfigurationPidTest.java:137) >> >> >> IIUC the problem is that ungetting the CA ref nulls out the field that d= oes the logging in the Configuration or ConfigurationAdminImpl, so calling = any method on the configuration that tries to log something will give an NP= E. >> >> You can call conf.getBundleLocation() successfully as long as you still = have the CA ref. >> >> I think this is an egregious bug in felix CA. Did I miss something in t= he spec that says this is OK and that configurations are only usable while = you hold the CA reference? >> >> I can think of 3 courses of action: >> >> 1. make the code structure worse in DS so that DS holds the ref until it= is done validating the configuration and extracting the properties. >> >> 2. require use of the R5 ca and try to get a CA release out with the 382= 0 fix fairly soon, DS will then not work with any older felix CA's (not sur= e about anyone else's' CA). >> >> 3. backport the 3820 fix to earlier felix CA's and do bug fix releases o= n them. I'm not aware of this (back porting) ever happening in felix=85 D= S users using felix CA would have to upgrade but not change framework leve= ls. >> >> I've implemented (1) but I'm not very happy about how the code looks. >> >> thoughts? >> >> thanks >> david jencks >> >> >> >> > > > -- > Felix Meschberger | Principal Scientist | Adobe > > > > > > >