Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-5210

Seemingly random NPEs from Aether resolver

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.1
    • 4.1.5, 4.2.0.M2
    • None
    • None
    • Windows

    • Important

    Description

      We have an installer that automates much of our Karaf and product installation.

      since the upgrade to Karaf 4.1, I've been getting these about every 5th automated install. could be timing? Happens at random places and sometimes with dependencies that the target doesn't have.

      One thing is that we do turn OFF internet access for maven through settings in the org.ops4j.pax.url.mvn.cfg and provider our out mvnsettings.xml. I will try and attach them later, but these are the relevant settings:

      org.ops4j.pax.url.mvn.settings=${karaf.etc}/mvnsettings.xml
      org.ops4j.pax.url.mvn.localRepository=${karaf.data}/repo
      org.ops4j.pax.url.mvn.useFallbackRepositories=false
      org.ops4j.pax.url.mvn.defaultRepositories=
      org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=true
      org.ops4j.pax.url.mvn.repositories= \
          file:${karaf.home}/${karaf.default.repository}@id=system.repository@snapshots,\
          file:${karaf.data}/kar@id=kar.repository@multi@snapshots
      

      mvnsettings.xml:

      <settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
        <localRepository>data/repo</localRepository>
      </settings>
      

      Here is what the stack looks like - note that the target bundle is almost always different on different failures.

      20170614 11:24:50.512 [INFO ] pipe-feature:install -v -r ngaudit | 10:org.apache.karaf.features.core | org.apache.karaf.features.internal.service.FeaturesServiceImpl | Adding features: ngaudit/[10.0.0.SNAPSHOT,10.0.0.SNAPSHOT]
      20170614 11:24:50.531 [ERROR] Thread-85 | 69:org.apache.karaf.shell.core | org.apache.karaf.shell.support.ShellUtil | 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)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:375)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:372)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:187)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:285)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1170)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$0(FeaturesServiceImpl.java:1069)[10:org.apache.karaf.features.core:4.1.1]
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_92]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_92]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_92]
          at java.lang.Thread.run(Thread.java:745)[:1.8.0_92]
      Caused by: java.io.IOException: Error downloading mvn:org.apache.karaf.jndi/org.apache.karaf.jndi.core/4.1.1
          at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:81)[10:org.apache.karaf.features.core:4.1.1]
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_92]
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_92]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_92]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_92]
          ... 3 more
      Caused by: java.lang.NullPointerException
          at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.getLocalRepository(AetherBasedResolver.java:1095)[6:org.ops4j.pax.url.mvn:2.5.2]
          at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.newSession(AetherBasedResolver.java:1011)[6:org.ops4j.pax.url.mvn:2.5.2]
          at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:701)[6:org.ops4j.pax.url.mvn:2.5.2]
          at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:659)[6:org.ops4j.pax.url.mvn:2.5.2]
          at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:600)[6:org.ops4j.pax.url.mvn:2.5.2]
          at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:567)[6:org.ops4j.pax.url.mvn:2.5.2]
          at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:47)[10:org.apache.karaf.features.core:4.1.1]
          at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)[10:org.apache.karaf.features.core:4.1.1]
          ... 7 more
      

      Here is another one. Note also that simply re-running the install works every time.

      20170615 06:43:45.551 [INFO ] pipe-feature:install -v -r ngam | 10:org.apache.karaf.features.core | org.apache.karaf.features.internal.service.FeaturesServiceImpl | Adding features: ngam/[10.0.0.SNAPSHOT,10.0.0.SNAPSHOT]
      20170615 06:43:45.564 [ERROR] Thread-82 | 69:org.apache.karaf.shell.core | org.apache.karaf.shell.support.ShellUtil | 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)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:375)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:372)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:187)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:285)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1170)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$0(FeaturesServiceImpl.java:1069)[10:org.apache.karaf.features.core:4.1.1]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_92]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_92]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_92]
      	at java.lang.Thread.run(Thread.java:745)[:1.8.0_92]
      Caused by: java.io.IOException: Error downloading mvn:org.apache.aries.jndi/org.apache.aries.jndi.url/1.1.0
      	at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:81)[10:org.apache.karaf.features.core:4.1.1]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_92]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_92]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_92]
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_92]
      	... 3 more
      Caused by: java.lang.NullPointerException
      	at org.ops4j.pax.url.mvn.internal.config.MavenConfigurationImpl.isOffline(MavenConfigurationImpl.java:128)[6:org.ops4j.pax.url.mvn:2.5.2]
      	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.createSession(AetherBasedResolver.java:1082)[6:org.ops4j.pax.url.mvn:2.5.2]
      	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.newSession(AetherBasedResolver.java:1019)[6:org.ops4j.pax.url.mvn:2.5.2]
      	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:701)[6:org.ops4j.pax.url.mvn:2.5.2]
      	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:659)[6:org.ops4j.pax.url.mvn:2.5.2]
      	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:600)[6:org.ops4j.pax.url.mvn:2.5.2]
      	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:567)[6:org.ops4j.pax.url.mvn:2.5.2]
      	at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:47)[10:org.apache.karaf.features.core:4.1.1]
      	at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)[10:org.apache.karaf.features.core:4.1.1]
      	... 7 more
      

      Attachments

        1. mvnsettings.xml
          0.3 kB
          Peter Berkman
        2. org.ops4j.pax.url.mvn.cfg
          8 kB
          Peter Berkman

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              pberkman Peter Berkman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: