我正在尝试在我的features.xml中使用fuse应用程序包工具,如http://fuse.fusesource.org/bundle/faq.html底部所述,并在启动时安装该功能,但我相信我的启动顺序有问题
我相信这是Fabric-bundle功能,包括我在org.apache.karaf.features.cfg文件中的Fuse Application Bundles包:
#
# Comma separated list of features to install at startup
#
featuresBoot=fabric-bundle,(some other features),myfeature
我的功能定义类似于以下内容:
<feature name="myfeature" version="${project.version}">
<bundle>fab:mvn:com.company/mybundle/${project.version}</bundle>
</feature>
但是在启动时我会在日志中注意到这一点:
16:31:20,785 | DEBUG | t-60024-thread-1 | FeaturesServiceImpl | 22 - org.apache.karaf.features.core - 2.3.0.redhat-60024 | Installing feature myfeature 2.0.0-SNAPSHOT
16:31:20,786 | DEBUG | t-60024-thread-1 | FeaturesServiceImpl | 22 - org.apache.karaf.features.core - 2.3.0.redhat-60024 | Checking fab:mvn:com.company/mybundle/2.0.0-SNAPSHOT
16:31:20,789 | WARN | t-60024-thread-1 | FeaturesServiceImpl | 22 - org.apache.karaf.features.core - 2.3.0.redhat-60024 | Error when installing feature myfeature: java.net.MalformedURLException: Unknown protocol: fab
我注意到Fuse Application Bundles捆绑包(fab-osgi)实际上是在3秒后启动的:
16:31:23,436 | DEBUG | lixDispatchQueue | fab-osgi | 61 - org.fusesource.fabric.fab.fab-osgi - 7.2.0.redhat-024 | BundleEvent STARTED - org.fusesource.fabric.fab.fab-osgi
因此,现在一旦服务器在shell中启动,我就可以运行
features:install myfeature
并且该功能已成功安装。
所以我认为我需要确保在尝试安装和启动我的功能之前,在启动时安装并启动了Fuse Application Bundles软件包。我怎样才能做到这一点?
干杯,
汤姆
答案 0 :(得分:0)
在我使用的Fuse版本中 - 6.0(Redhat 60042) - 结构包及其依赖项在功能包之前未启动,因此功能包不了解fab协议。通过将以下内容添加到startup.properties来确保在功能包之前启动结构捆绑包:
org/fusesource/fabric/fab/fab-osgi/7.2.0.redhat-024/fab-osgi-7.2.0.redhat-024.jar=10
org/fusesource/fabric/common-util/7.2.0.redhat-024/common-util-7.2.0.redhat-024.jar=10
org/ops4j/base/ops4j-base-net/1.2.2/ops4j-base-net-1.2.2.jar=10
org/ops4j/base/ops4j-base-lang/1.2.2/ops4j-base-lang-1.2.2.jar=10
org/ops4j/base/ops4j-base-util-property/1.2.2/ops4j-base-util-property-1.2.2.jar=10
org/ops4j/pax/swissbox/pax-swissbox-optional-jcl/1.3.1/pax-swissbox-optional-jcl-1.3.1.jar=10
org/ops4j/base/ops4j-base-monitors/1.2.2/ops4j-base-monitors-1.2.2.jar=10
org/ops4j/pax/swissbox/pax-swissbox-property/1.2.0/pax-swissbox-property-1.2.0.jar=10
我不确定10是否是一个合适的起始等级,但它似乎对我没有任何问题。