我想在Karaf重启时从maven安装一个捆绑包(如果它尚未安装)。为实现这一点,我将其添加到/etc/startup.properties
中,如下所示: -
# add here bundles you want to install while system startup, e.g.
# joda-time/joda-time/2.9/joda-time-2.9.jar=10
mvn\:com.fasterxml.jackson.core/jackson-annotations/2.7.4 = 10
但是在尝试启动karaf时,我得到以下异常: -
jabongs-MacBook-Pro-4:apache-servicemix-6.1-2.0 debraj$ bin/servicemix
Please wait while Apache ServiceMix is starting...
Error installing bundle listed in startup.properties with url: mvn:com.fasterxml.jackson.core/jackson-annotations/2.7.4 and startlevel: 10
Exception in thread "main" java.lang.NullPointerException
at org.apache.karaf.main.Main.destroy(Main.java:533)
at org.apache.karaf.main.Main.main(Main.java:173)
当我尝试在Karaf启动后通过以下命令安装它时,同样的捆绑包安装正常: -
karaf@root>bundle:install mvn:com.fasterxml.jackson.core/jackson-annotations/2.7.4
Bundle ID: 237
有些人可以帮助我: -
startup.properties
中安装捆绑包吗?#2
的答案是肯定的,那么在Karaf还有其他地方我可以放置捆绑名称,以便Karaf在重启时每次尝试安装它(如果尚未安装)? / LI>
醇>
环境: -
Karaf 3.0.5
Apache Serviemix 6.1.0
答案 0 :(得分:1)
mvn:url解析器可能没有连线。尝试在没有mvn的情况下添加它:并确保jar在系统/文件夹中。
如果这是针对商业代码而非容器/产品扩展类型代码,最好的办法是构建一个功能并将其添加到etc / org.apache.karaf.features.cfg featuresBoot