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

NPE when building karaf-assembly target with installAllFeaturesByDefault=false

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4
    • Fix Version/s: 4.0.4
    • Component/s: karaf
    • Labels:
      None
    • Environment:

      Description

      I have a karaf sample project spanning multiple bundles that get combined into a single KAR. The KAR is then packaged through a karaf-assembly module in a karaf distro.

      The project can be found at: https://github.com/tonyganchev/blog/commit/807ed40c80b597d90ecb955b28ccf613b7e02bfd (pointed to the revision that introduces the issue)

      When setting installAllFeaturesByDefault to false I get the following exception (on 4.0.4-SNAPSHOT in this case, but essentially the same on all 4.0.x versions)

      [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.4-SNAPSHOT:assembly (default-assembly) on project karaf-assembly: Unable to build assembly: NullPointerException -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.0.4-SNAPSHOT:assembly (default-assembly) on project karaf-assembly: Unable to build assembly
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to build assembly
      at org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.java:234)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      ... 20 more
      Caused by: java.lang.NullPointerException
      at org.apache.karaf.features.internal.region.SubsystemResolver.collectPrerequisites(SubsystemResolver.java:175)
      at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:223)
      at org.apache.karaf.profile.assembly.Builder.resolve(Builder.java:1214)
      at org.apache.karaf.profile.assembly.Builder.startupStage(Builder.java:1002)
      at org.apache.karaf.profile.assembly.Builder.doGenerateAssembly(Builder.java:606)
      at org.apache.karaf.profile.assembly.Builder.generateAssembly(Builder.java:389)
      at org.apache.karaf.tooling.AssemblyMojo.doExecute(AssemblyMojo.java:392)
      at org.apache.karaf.tooling.AssemblyMojo.execute(AssemblyMojo.java:228)
      ... 22 more

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              tony.ganchev Tony Ganchev
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: