【问题标题】:Karaf 3.0.x config:update command does not create .cfg file in /etcKaraf 3.0.x config:update 命令不在 /etc 中创建 .cfg 文件
【发布时间】:2014-07-23 14:53:45
【问题描述】:

我在捆绑包中使用 karaf 3.0.1 (https://github.com/johanlelan/camel-cxfrs-blueprint-example)。我想在运行时管理属性,但我看到 config:update 没有在 /etc 上创建文件,为什么?

<cm:property-placeholder persistent-id="org.apache.camel.examples.cxfrs.blueprint"
    update-strategy="reload">
    <!-- list some properties for this test -->
    <cm:default-properties>
        <cm:property name="cxf.application.in"
            value="cxfrs:bean:rest.endpoint?throwExceptionOnFailure=false&amp;bindingStyle=SimpleConsumer&amp;loggingFeatureEnabled=true"/>
        <cm:property name="common.tenant.in" value="direct-vm:common.tenant.in"/>
        <cm:property name="common.authentication.in" value="direct-vm:common.authentication.in"/>
        <cm:property name="application.put.in" value="direct-vm:application.putById"/>
        <cm:property name="application.post.in"
            value="direct-vm:application.postApplications"/>
        <cm:property name="log.trace.level" value="INFO"/>
    </cm:default-properties>
</cm:property-placeholder>

在 karaf 我尝试修改端点 url:

karaf@root()> config:edit org.apache.camel.examples.cxfrs.blueprint
karaf@root()> config:property-set common.tenant.in direct-vm:test
karaf@root()> config:property-list
   service.pid = org.apache.camel.examples.cxfrs.blueprint
   common.tenant.in = direct-vm:test
   felix.fileinstall.filename = file:/F:/travail/servers/karaf-lan/etc/org.apache.camel.examples.cxfrs.blueprint.cfg    
karaf@root()> config:update
karaf@root()>

我确切地说我的包在 config:update 之后更新了,但 /etc 中不存在文件...我认为它适用于 karaf 2.3.5。

【问题讨论】:

    标签: blueprint karaf


    【解决方案1】:

    配置由 ConfigurationAdmin 服务持久化。如果您使用的是 Karaf,它使用来自 Felix ConfigAdmin [1] 的实现。默认情况下,Karaf 将 ConfigAdmin 配置为将文件存储在 /data 下的本地包存储区域中,但可以通过编辑 felix.cm.dir 属性来更改。

    此外,对 .cfg 文件的支持来自 Felix FileInstall [2]。

    [1]http://felix.apache.org/documentation/subprojects/apache-felix-config-admin.html [2]http://felix.apache.org/site/apache-felix-file-install.html

    【讨论】:

      【解决方案2】:

      在 karaf 3.0.1 是已知的 issue

      您可以使用 apache karaf 3.0.2 修复此错误。

      【讨论】:

        猜你喜欢
        • 2017-11-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-27
        • 1970-01-01
        相关资源
        最近更新 更多