gpt4 book ai didi

apache-camel - Fuse ESB/OSGI/Blueprint 按字母顺序读取配置文件?

转载 作者:行者123 更新时间:2023-12-02 15:03:32 25 4
gpt4 key购买 nike

我经历了一些相当奇怪的事情,我想知道其他人是否也经历过同样的事情......

我目前正在开发一个使用jboss fusion(以前称为fuse esb)的项目,并且我们正在使用蓝图作为配置文件。我们使用属性占位符,并在 src/main/resources/OSGI-INF/blueprint 下有以下文件:蓝图.xml属性.xml

在 blueprint.xml 中,我们有这样的内容:

<bean id="myBean" class="com.test.MyClass">
<property name="prop1" value="${my.prop}" />
<∕bean>

然后在properties.xml中我有这个:

<cm:property-placeholder persistent-id="my.properties" update-strategy="reload">
<cm:default-properties>
<cm:property name="my.prop" value="true" />
</cm:default-properties>
</cm:property-placeholder>

显然,我在 MyClass 中有一个 prop1(它是一个字符串)的 setter 。

但我看到的是,当我部署它时,prop1 设置为“${my.prop}”而不是“true”,即变量永远不会被其定义的值替换!

但是现在如果我调用属性文件aaa_properties.xml,它就可以工作了!!

这是蓝图容器中的错误吗?其他人也经历过同样的行为吗?

感谢您的反馈:)

JM。

最佳答案

我找到了一些关于Blueprint Configuration in Fuse ESB的信息

它指出:

If you need to place your blueprint configuration files in a non-standard location (that is, somewhere other than OSGI-INF/blueprint/*.xml), you can specify a comma-separated list of alternative locations in the Bundle-Blueprint header in the manifest

例如:

Bundle-Blueprint: lib/account.xml, security.bp, cnf/*.xml

我建议,您能否尝试一下,并在此处指定您的 xml 文件,当然要按正确的顺序。

关于apache-camel - Fuse ESB/OSGI/Blueprint 按字母顺序读取配置文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21633015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com