Quantcast

Config:propset clears other configuration properties not specified in command

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Config:propset clears other configuration properties not specified in command

ibarnett
In Karaf 2.2.2 I was able to edit one property in a configuration without affecting the others.  For example, I have a configuration in karaf/etc with file name of Query_Service-ID1234.cfg that has the following properties:
id = ABC123
queryUrl = http://123.45.67.89/query
maximumResults = 10
failOnError = false

If I wanted to change the configuration property "maximumResults" from 10 to 500, in 2.2.2 I could run the following command in the Karaf console:
config:edit Query_Service-ID1234; config:propset maximumResults 500; config:update

That command would just update the value of "maximumResults."  

When I run this same command in Karaf 2.2.5, it successfully updates the "maximumResults" property, but it removes all other properties from my configuration and the resulting Query_Service-ID1234.cfg file looks like this:
maximumResults = 500

All other properties were removed.  

What is the recommended way to update a single value in my configuration from the command line?  

In an attempt to get the behavior I wanted I tried running the above command with a -f argument to reference the file name instead of the PID since I am using a managed service factory to create instances of "Query_Service."  This worked on Unix from the Karaf command line.  However, this did not work on Windows.   I get the following error: "Could not find configuration with file install property set to: Query_Service-ID1234."  I have verified that the file "Query_Service-ID1234.cfg" is in karaf/etc.
The command I ran was:
config:edit -f Query_Service-ID1234; config:propset maximumResults 500; config:update

Thanks for you help.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Config:propset clears other configuration properties not specified in command

helander
I have experienced the same (or similar) problem. I am trying to do the same but via JMX (using the Jolokia OSGi Bundle and a Javascript client). I get the exact same behaviour, i.e. setting a new property deletes all existing settings, but the new one remians. My first guess was that it was some error in Jolokia or the MBean server, but it now sounda more like a problem in the Karaf config service.

/Lars
Loading...