Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-6499

Exception in features:install command should tell why it failed

XMLWordPrintable

    • Icon: Feature Feature
    • Resolution: Done
    • Icon: Minor Minor
    • fuse-6.x-GA
    • jboss-fuse-6.3
    • Karaf
    • 0
    • 0% 0%
    • Todo

      Issuing command features:install on Fuse 6.3 may throw following error

      2017-01-23 19:56:32,346 | ERROR | l Console Thread | Console                          | 38 - org.apache.karaf.shell.console - 2.4.0.redhat-630187 | Exception caught while executing command
      java.lang.NullPointerException
              at org.apache.felix.bundlerepository.impl.ResolverImpl.getResources(ResolverImpl.java:155)[8:org.apache.felix.bundlerepository:2.0.4]
              at org.apache.felix.bundlerepository.impl.ResolverImpl.resolve(ResolverImpl.java:172)[8:org.apache.felix.bundlerepository:2.0.4]
              at org.apache.felix.bundlerepository.impl.ResolverImpl.resolve(ResolverImpl.java:166)[8:org.apache.felix.bundlerepository:2.0.4]
              at org.apache.karaf.features.obr.internal.ObrResolver.doResolve(ObrResolver.java:166)[13:org.apache.karaf.features.obr:2.4.0.redhat-630187]
              at org.apache.karaf.features.obr.internal.ObrResolver.resolve(ObrResolver.java:116)[13:org.apache.karaf.features.obr:2.4.0.redhat-630187]
              at org.apache.karaf.features.internal.FeaturesServiceImpl.resolve(FeaturesServiceImpl.java:813)[10:org.apache.karaf.features.core:2.4.0.redhat-630187]
              at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:702)[10:org.apache.karaf.features.core:2.4.0.redhat-630187]
              at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeatures(FeaturesServiceImpl.java:462)[10:org.apache.karaf.features.core:2.4.0.redhat-630187]
              at org.apache.karaf.features.internal.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:432)[10:org.apache.karaf.features.core:2.4.0.redhat-630187]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_111]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_111]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_111]
              at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
      

      which is not helpful at all

      Compared to same situation in karaf 4.1:

      2017-01-23T19:59:23,548 | ERROR | Karaf local console user karaf | ShellUtil                        | 44 - org.apache.karaf.shell.core - 4.1.0.SNAPSHOT | Exception caught while executing command
      org.apache.karaf.features.internal.util.MultiException: Error
      	at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:84) ~[?:?]
      	at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72) ~[?:?]
      	at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:375) ~[?:?]
      	at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:372) ~[?:?]
      	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:187) ~[?:?]
      	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:285) ~[?:?]
      	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1170) ~[?:?]
      	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$0(FeaturesServiceImpl.java:1069) ~[?:?]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
      	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) [?:?]
      	Suppressed: java.lang.Exception: Unable to create resource for bundle mvn:org.bouncycastle/bcmail-jdk15/1.44
      		at org.apache.karaf.features.internal.region.Subsystem.createResource(Subsystem.java:617) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.region.Subsystem$1.downloaded(Subsystem.java:402) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader$1.operationComplete(MavenDownloadManager.java:133) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader$1.operationComplete(MavenDownloadManager.java:127) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.download.impl.DefaultFuture.notifyListener(DefaultFuture.java:350) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.download.impl.DefaultFuture.notifyListeners(DefaultFuture.java:335) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.download.impl.DefaultFuture.setValue(DefaultFuture.java:259) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.download.impl.AbstractDownloadTask.setFile(AbstractDownloadTask.java:61) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:61) [9:org.apache.karaf.features.core:4.1.0.SNAPSHOT]
      		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.bouncycastle/bcmail-jdk15/1.44: Unsupported 'Bundle-ManifestVersion' value: 1
      		at org.apache.karaf.features.internal.resolver.ResourceBuilder.build(ResourceBuilder.java:80) ~[?:?]
      		at org.apache.karaf.features.internal.resolver.ResourceBuilder.build(ResourceBuilder.java:69) ~[?:?]
      		at org.apache.karaf.features.internal.region.Subsystem.createResource(Subsystem.java:615) ~[?:?]
      		... 15 more
      

      Where one can read the important part: Unsupported 'Bundle-ManifestVersion' value: 1

      The problem was that features.xml had bundle entry and given bundle didn't have proper osgi headers in manifest.

      Can we make fuse 6.3 more helpful to developers?

      Reproducer

      JBossFuse:karaf@root> features:addurl https://issues.jboss.org/secure/attachment/12415442/features-bouncy-144.xml
      JBossFuse:karaf@root> features:install test144
      Error executing command: java.lang.NullPointerException
      JBossFuse:karaf@root> log:tail
      
      JBossFuse:karaf@root> features:install test146
      

              ggrzybek Grzegorz Grzybek
              jludvice Josef Ludvicek (Inactive)
              Josef Ludvicek Josef Ludvicek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: