1

Hi guys i am getting the below error while using feture install in karaf

org.apache.karaf.features.internal.util.MultiException: Error
    at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:84)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:358)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:355)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:191)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)[9:org.apache.karaf.features.core:4.0.3]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
Caused by: java.lang.Exception: Unable to create resource for bundle mvn:org.dt.dummy/Diff-Blueprint/0.0.1-SNAPSHOT
    at org.apache.karaf.features.internal.region.Subsystem.createResource(Subsystem.java:567)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.region.Subsystem$1.downloaded(Subsystem.java:376)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader$1.operationComplete(MavenDownloadManager.java:133)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader$1.operationComplete(MavenDownloadManager.java:127)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.DefaultFuture.notifyListener(DefaultFuture.java:344)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.DefaultFuture.notifyListeners(DefaultFuture.java:329)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.DefaultFuture.setValue(DefaultFuture.java:255)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.AbstractDownloadTask.setFile(AbstractDownloadTask.java:61)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:59)[9:org.apache.karaf.features.core:4.0.3]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_79]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_79]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_79]
    ... 3 more
Caused by: org.osgi.framework.BundleException: Unable to build resource for mvn:org.dt.dummy/Diff-Blueprint/0.0.1-SNAPSHOT: Unsupported 'Bundle-ManifestVersion' value: 1
    at org.apache.karaf.features.internal.resolver.ResourceBuilder.build(ResourceBuilder.java:80)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.resolver.ResourceBuilder.build(ResourceBuilder.java:69)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.region.Subsystem.createResource(Subsystem.java:565)[9:org.apache.karaf.features.core:4.0.3]
    ... 15 more
Caused by: org.osgi.framework.BundleException: Unsupported 'Bundle-ManifestVersion' value: 1
    at org.apache.karaf.features.internal.resolver.ResourceBuilder.doBuild(ResourceBuilder.java:88)[9:org.apache.karaf.features.core:4.0.3]
    at org.apache.karaf.features.internal.resolver.ResourceBuilder.build(ResourceBuilder.java:78)[9:org.apache.karaf.features.core:4.0.3]
    ... 17 more

feature.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="Diff-Blueprint">
    <feature name="Diff-Blueprint" description="Diff-Blueprint" version="0.0.1.SNAPSHOT">
        <feature prerequisite="true" dependency="false">wrap</feature>
        <bundle>mvn:org.dt.dummy/Diff-Blueprint/0.0.1-SNAPSHOT</bundle>
        <bundle>wrap:mvn:osgi/osgi/3.0.1</bundle>
        <bundle>wrap:mvn:javax.xml/xml/3.1.0</bundle>
        <bundle>wrap:mvn:xmlunit/xmlunit/1.6</bundle>
        <bundle>wrap:mvn:junit/junit/4.11</bundle>
        <bundle>wrap:mvn:org.hamcrest/hamcrest-core/1.3</bundle>
        <bundle>mvn:com.googlecode.json-simple/json-simple/1.1.1</bundle>
        <bundle>wrap:mvn:de.odysseus.staxon/staxon-jackson/1.2</bundle>
        <bundle>mvn:com.fasterxml.jackson.core/jackson-core/2.0.6</bundle>
        <bundle>wrap:mvn:de.odysseus.staxon/staxon/1.2</bundle>
        <bundle>mvn:log4j/log4j/1.2.17</bundle>
        <bundle>mvn:org.codehaus.jackson/jackson-mapper-asl/1.9.13</bundle>
        <bundle>mvn:org.codehaus.jackson/jackson-core-asl/1.9.13</bundle>
        <bundle>wrap:mvn:org.unitils/unitils/2.4</bundle>
        <bundle>wrap:mvn:commons-logging/commons-logging/1.1</bundle>
        <bundle>wrap:mvn:commons-dbcp/commons-dbcp/1.2.2</bundle>
        <bundle>wrap:mvn:commons-pool/commons-pool/1.3</bundle>
        <bundle>wrap:mvn:commons-lang/commons-lang/2.3</bundle>
        <bundle>wrap:mvn:commons-collections/commons-collections/3.2</bundle>
        <bundle>wrap:mvn:ognl/ognl/2.6.9</bundle>
        <bundle>wrap:mvn:ant/ant/1.6.5</bundle>
    </feature>
</features>
Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
Charity
  • 213
  • 1
  • 5
  • 23
  • The problem seems to be with your own artifact org.dt.dummy/Diff-Blueprint/0.0.1-SNAPSHOT. How do you create it and what does the Manifest of it look like? – Christian Schneider Feb 05 '16 at 16:31

4 Answers4

6

Appreciate that I am resurrecting an old thread here, but to elaborate on @Charity's answer, for anybody who discovers this at a later date (as I did)...

The problem is that we are trying to deploy a non-OSGi compliant bundle, to the container. The solution is to "wrap" the bundle that is causing you problems, by using the Wrap protocol described in the OPS4J Wiki.

JAR Example

A simple example using Maven is shown below:

wrap:mvn:commons-logging/commons-logging/1.1

Note that we have to prefix the bundle with "wrap:", and that is all. See the wiki for more complex examples which override settings defined in the manifest.

WAR Example

Deploy a non-OSGi compliant WAR file in much the same way, using the "webbundle" URI handler instead:

webbundle:mvn:com.example/example-web-app/1.0/war
Daniel Scarfe
  • 199
  • 1
  • 8
1

I have found a solution if we wrap the jars which throw Bundle-ManifestVersion: 1 then this will work

Charity
  • 213
  • 1
  • 5
  • 23
0

Evidently the Diff-Blueprint bundle has Bundle-ManifestVersion: 1 as a MANIFEST.MF header. This indicates that it predates OSGi Release 4.0, which was released in 2005, so it's unsurprising that a modern version of Karaf does not support it.

So you will have to look into the tool that produced that bundle.

Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
  • I am able to deploy the same thing without using feature.xml. The way i deployed is i copied all the dependencies and application bundle jar in the deploy folder of karaf and restarted the instance. – Charity Feb 05 '16 at 19:01
  • Perhaps the feature points at a different version. Anyway it's all just guesswork if you don't post the relevant information such as the bundle manifest. – Neil Bartlett Feb 05 '16 at 19:57
  • I have checked the feature.xml there is no Bundleversion mentioned there. Is it possible to have this error if one of the dependent jars have a different BundleVersion – Charity Feb 06 '16 at 17:54
  • No. `Bundle-Version` is not the same as `Bundle-ManifestVersion`. – Neil Bartlett Feb 06 '16 at 21:46
0

Try to edit MANIFEST.MF file of problematic bundle, just change
Bundle-ManifestVersion with value of 2 instead of 1.

vetalok
  • 173
  • 1
  • 12
  • 1
    I cant do that because these are third party jars which are not karaf friendly. The only solution is to wrap the jars. Wrapping is a feature provided by karaf. – Charity Feb 23 '16 at 17:56
  • Setting `Bundle-ManifestVersion` to `2` doesn't make JAR an OSGi bundle – Grzegorz Grzybek Sep 29 '17 at 14:19