Dariush Amiri created KARAF-4885: ------------------------------------ Summary: Karaf does not gracefully handle a feature with a prerequisite feature that is already installed Key: KARAF-4885 URL: https://issues.apache.org/jira/browse/KARAF-4885 Project: Karaf Issue Type: Bug Affects Versions: 4.1.0 Reporter: Dariush Amiri
Here is a project on github that reproduces this issue: https://github.com/damiri-ts/karaf-features-issue After more investigation, the root cause seems to be the inability of karaf to gracefully handle situations where a child feature has a prerequisite feature that is already installed as part of a parent feature. It's confusing so I've included the feature definition below. Note that the aries-blueprint feature shows up twice. <feature name="something-else" version="${project.version}" description="Something else"> <feature prerequisite="true">jasypt-encryption</feature> <feature prerequisite="true">aries-blueprint</feature> </feature> <feature name="example" version="${project.version}" description="Example"> <feature>framework</feature> <feature>wrap</feature> <feature>aries-blueprint</feature> <feature>shell</feature> <feature>shell-compat</feature> <feature>feature</feature> <feature>jaas</feature> <feature>ssh</feature> <feature>management</feature> <feature>bundle</feature> <feature>config</feature> <feature>deployer</feature> <feature>diagnostic</feature> <feature>instance</feature> <feature>kar</feature> <feature>log</feature> <feature>package</feature> <feature>service</feature> <feature>system</feature> <feature>scr</feature> <feature>jetty</feature> <feature>pax-http-whiteboard</feature> <feature>something-else</feature> </feature> This manifests itself in the logs like this: 2016-12-05T18:23:57,843 | ERROR | FelixStartLevel | Felix | - - | Bundle org.objectweb.asm.all [54] Error locking mvn:org.ow2.asm/asm-all/6.0_ALPHA (java.lang.IllegalStateException: Bundle in unexpected state.) java.lang.IllegalStateException: Bundle in unexpected state. at org.apache.felix.framework.Felix.acquireBundleLock(Felix.java:5272) [?:?] at org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1524) [?:?] at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:338) [?:?] at java.lang.Thread.run(Thread.java:745) [?:?] 2016-12-05T18:23:57,844 | INFO | CM Configuration Updater (ManagedService Update: pid=[org.apache.cxf.osgi]) | TldScanner | 189 - org.ops4j.pax.web.pax-web-jsp - 4.4.0 | found TLD bundle://189.0:0/META-INF/c.tld 2016-12-05T18:23:57,841 | ERROR | FelixDispatchQueue | all | 184 - org.objectweb.asm.all - 5.0.2 | FrameworkEvent ERROR - org.objectweb.asm.all java.lang.IllegalStateException: Bundle in unexpected state. at org.apache.felix.framework.Felix.acquireBundleLock(Felix.java:5272) [?:?] at org.apache.felix.framework.Felix.setBundleStartLevel(Felix.java:1524) [?:?] at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:338) [?:?] at java.lang.Thread.run(Thread.java:745) [?:?] -- This message was sent by Atlassian JIRA (v6.3.4#6332)