我正在尝试在我的 features.xml 中使用 fuse 应用程序捆绑工具,如http://fuse.fusesource.org/bundle/faq.html底部所述,并在启动时安装该功能,但是我相信我是启动顺序有问题。
我相信这是我在 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 捆绑包已安装并在启动时启动。我怎样才能做到这一点?
干杯,
汤姆