[ 
https://issues.apache.org/jira/browse/FELIX-5850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16471514#comment-16471514
 ] 

Jean-Baptiste Onofré commented on FELIX-5850:
---------------------------------------------

That's the error I have before the change:

{code}
        Suppressed: java.lang.Exception: Unable to create resource for bundle 
mvn:org.apache.karaf.itests/itests/4.2.1-SNAPSHOT
                at 
org.apache.karaf.features.internal.region.Subsystem.createResource(Subsystem.java:824)
 ~[?:?]
                at 
org.apache.karaf.features.internal.region.Subsystem.lambda$downloadBundles$1(Subsystem.java:499)
 ~[?:?]
                at 
org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.lambda$download$0(MavenDownloadManager.java:138)
 ~[?:?]
                at 
org.apache.karaf.features.internal.download.impl.DefaultFuture.notifyListener(DefaultFuture.java:350)
 ~[?:?]
                at 
org.apache.karaf.features.internal.download.impl.DefaultFuture.notifyListeners(DefaultFuture.java:335)
 ~[?:?]
                at 
org.apache.karaf.features.internal.download.impl.DefaultFuture.setValue(DefaultFuture.java:259)
 ~[?:?]
                at 
org.apache.karaf.features.internal.download.impl.AbstractDownloadTask.setFile(AbstractDownloadTask.java:61)
 ~[?:?]
                at 
org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:61)
 ~[?:?]
                at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
                at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
[?:?]
                at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 ~[?:?]
                at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 ~[?:?]
                at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[?:?]
                at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[?:?]
                at java.lang.Thread.run(Thread.java:745) [?:?]
        Caused by: org.osgi.framework.BundleException: Unable to build resource 
for mvn:org.apache.karaf.itests/itests/4.2.1-SNAPSHOT: Unsupported 
'Bundle-ManifestVersion' value: 1
                at 
org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:82) 
~[?:?]
                at 
org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:71) 
~[?:?]
                at 
org.apache.karaf.features.internal.region.Subsystem.createResource(Subsystem.java:822)
 ~[?:?]
                ... 14 more
        Caused by: org.osgi.framework.BundleException: Unsupported 
'Bundle-ManifestVersion' value: 1
                at 
org.apache.felix.utils.resource.ResourceBuilder.doBuild(ResourceBuilder.java:90)
 ~[?:?]
                at 
org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:80) 
~[?:?]
                at 
org.apache.felix.utils.resource.ResourceBuilder.build(ResourceBuilder.java:71) 
~[?:?]
                at 
org.apache.karaf.features.internal.region.Subsystem.createResource(Subsystem.java:822)
 ~[?:?]
                ... 14 more

{code}

> ResourceBuilder should do deal with null bundle manifest version
> ----------------------------------------------------------------
>
>                 Key: FELIX-5850
>                 URL: https://issues.apache.org/jira/browse/FELIX-5850
>             Project: Felix
>          Issue Type: Bug
>          Components: Utils
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: utils-1.11.2
>
>
> The {{ResourceBuilder#doBuild}} should deal with empty (null) bundle manifest 
> version.
> We should do:
> {code}
>     private static String getBundleManifestVersion(Map<String, String> 
> headerMap) {
>         return headerMap.get(Constants.BUNDLE_MANIFESTVERSION);
>     }
>    ...
>            // Verify that only manifest version 2 is specified.
>         String manifestVersion = getBundleManifestVersion(headerMap);
>         if (!"2".equals(manifestVersion)) {
>             throw new BundleException("Bundle-ManifestVersion must be 2 but 
> is: " + manifestVersion);
>         }
> {code}
> I will provide a PR (and test with Karaf itest).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to