Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EEC8110EB4 for ; Thu, 16 Jan 2014 13:33:21 +0000 (UTC) Received: (qmail 82704 invoked by uid 500); 16 Jan 2014 13:33:21 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 82601 invoked by uid 500); 16 Jan 2014 13:33:20 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 82579 invoked by uid 99); 16 Jan 2014 13:33:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jan 2014 13:33:20 +0000 Date: Thu, 16 Jan 2014 13:33:20 +0000 (UTC) From: =?utf-8?Q?Jean-Baptiste_Onofr=C3=A9_=28JIRA=29?= To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (KARAF-2366) Cannot Update Factory Configuration Not Backed By A File With The "config:" Command MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-2366?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Onofr=C3=A9 resolved KARAF-2366. ----------------------------------------- Resolution: Not A Problem You have to use the -f option (--file) to the config:edit command in order = to manipulate factories. Christian did enhancements around that in Karaf 3.= 0.0. > Cannot Update Factory Configuration Not Backed By A File With The "config= :" Command > -------------------------------------------------------------------------= ---------- > > Key: KARAF-2366 > URL: https://issues.apache.org/jira/browse/KARAF-2366 > Project: Karaf > Issue Type: Bug > Components: karaf-config > Affects Versions: 2.3.1 > Reporter: Gareth Collins > Assignee: Jean-Baptiste Onofr=C3=A9 > Fix For: 2.4.0, 3.0.1, 2.3.4 > > > This is related to this thread in the mailing list: > http://karaf.922171.n3.nabble.com/Updating-Managed-Service-Factory-Config= -Via-quot-config-quot-commands-td4028322.html#a4028325 > In summary, it does not appear to be possible to update a factory configu= ration not backed by a file (e.g. one created via a karaf feature file). > If I have a configuration like this: > Pid: com.mycompany.myservice.327d4cd4-4704-4190-9e51-26f5f0b91= 435=20 > FactoryPid: com.mycompany.myservice=20 > BundleLocation: mvn:com.mycompany/mycompany/1.0.0-SNAPSHOT=20 > Properties:=20 > myservice.host =3D 0.0.0.0=20 > myservice.port =3D 8080=20 > org.apache.karaf.features.configKey =3D com.mycompany.myservice-health= check=20 > service.factoryPid =3D com.mycompany.myservice=20 > service.pid =3D com.mycompany.myservice.327d4cd4-4704-4190-9e51-26f5f0= b91435=20 > and try to edit the configuration. e.g.:=20 > config:edit com.mycompany.myservice-healthcheck=20 > config:propset myservice.port =3D 8081=20 > config:update=20 > I get a new config:=20 > Pid: com.mycompany.myservice.8cbfea87-f66e-44b4-b94a-11fdb14c2= 35f=20 > FactoryPid: com.mycompany.myservice=20 > BundleLocation: mvn:com.antennasoftware/gravity.clientAP.blueprint/1.0.0-= SNAPSHOT=20 > Properties:=20 > service.pid =3D com.mycompany.myservice.8cbfea87-f66e-44b4-b94a-11fdb1= 4c235f=20 > myservice.port =3D 8081=20 > service.factoryPid =3D com.mycompany.myservice=20 > felix.fileinstall.filename =3D file:/home/karaf/apache-karaf-2.3.1/etc= /com.mycompany.myservice-healthcheck.cfg=20 > If I go and specify the pid exactly:=20 > > config:edit com.mycompany.myservice.327d4cd4-4704-4190-9e51-26f5f0b9143= 5=20 > > config:propset myservice.port 8081=20 > > config:update=20 > Nothing happens. > If I try the "-f" option (which I understand should create a file) I get = a NullPointerException: > 2013-03-26 21:10:08,231 | INFO | []:[] | Thread-8220 | Console = | araf.shell.console.jline.Console 198 | 14 - org.ap= ache.karaf.shell.console - 2.3.1 | Exception caught while executing command= =20 > java.lang.NullPointerException=20 > at org.apache.karaf.shell.config.ConfigCommandSupport.findConfigu= rationByFileName(ConfigCommandSupport.java:115)=20 > at org.apache.karaf.shell.config.EditCommand.doExecute(EditComman= d.java:50)=20 > at org.apache.karaf.shell.config.ConfigCommandSupport.doExecute(C= onfigCommandSupport.java:68)=20 > at org.apache.karaf.shell.console.OsgiCommandSupport.execute(Osgi= CommandSupport.java:38)=20 > at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(A= bstractCommand.java:35)=20 > at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProx= y.java:78)=20 > at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:= 474)=20 > at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure= .java:400)=20 > at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)=20 > at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183= )=20 > at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120= )=20 > at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(Comma= ndSessionImpl.java:89)=20 > at org.apache.karaf.shell.console.jline.Console.run(Console.java:= 174)=20 > at java.lang.Thread.run(Unknown Source)[:1.7.0_05]=20 > at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$4.doRun(= ShellFactoryImpl.java:144)[28:org.apache.karaf.shell.ssh:2.3.1]=20 > at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$4$1.run(= ShellFactoryImpl.java:135)=20 > at java.security.AccessController.doPrivileged(Native Method)[:1.= 7.0_05]=20 > at javax.security.auth.Subject.doAs(Unknown Source)[:1.7.0_05]=20 > at org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$4.run(Sh= ellFactoryImpl.java:133)[28:org.apache.karaf.shell.ssh:2.3.1]=20 -- This message was sent by Atlassian JIRA (v6.1.5#6160)