Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10223

org.osgi.framework.Version not contained in lib folder generated from appassembly

    XMLWordPrintableJSON

Details

    Description

      The application generated by appassembler-maven-plugin (https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/1b7f2e900f1474809b66b57c0564e1727ff8c8de/pom.xml#L291) only includes dependencies of scope "provided" (https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/1b7f2e900f1474809b66b57c0564e1727ff8c8de/src/main/assembly/bin.xml#L65).

      But the class org.osgi.framework.Version used in https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/1b7f2e900f1474809b66b57c0564e1727ff8c8de/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java#L99 is only provided via the dependency org.osgi:osgi.core:7.0.0 in scope compile in https://github.com/apache/sling-org-apache-sling-feature-cpconverter/blob/1b7f2e900f1474809b66b57c0564e1727ff8c8de/pom.xml#L170.

      That leads to exceptions like these

      java.lang.NoClassDefFoundError: org/osgi/framework/Version
      	at org.apache.sling.feature.cpconverter.handlers.BundleEntryHandler.handle(BundleEntryHandler.java:99)
      	at org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.onFile(ContentPackage2FeatureModelConverter.java:401)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:110)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:102)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:102)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:102)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:102)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:102)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:102)
      	at org.apache.sling.feature.cpconverter.vltpkg.BaseVaultPackageScanner.traverse(BaseVaultPackageScanner.java:89)
      	at org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.secondPass(ContentPackage2FeatureModelConverter.java:246)
      	at org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.convert(ContentPackage2FeatureModelConverter.java:194)
      	at org.apache.sling.feature.cpconverter.cli.ContentPackage2FeatureModelConverterLauncher.run(ContentPackage2FeatureModelConverterLauncher.java:184)
      	at picocli.CommandLine.execute(CommandLine.java:996)
      	at picocli.CommandLine.access$900(CommandLine.java:142)
      	at picocli.CommandLine$RunLast.handle(CommandLine.java:1199)
      	at picocli.CommandLine$RunLast.handle(CommandLine.java:1167)
      	at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1075)
      	at picocli.CommandLine.parseWithHandlers(CommandLine.java:1358)
      	at picocli.CommandLine.run(CommandLine.java:1817)
      	at picocli.CommandLine.run(CommandLine.java:1747)
      	at org.apache.sling.feature.cpconverter.cli.ContentPackage2FeatureModelConverterLauncher.main(ContentPackage2FeatureModelConverterLauncher.java:308)
      Caused by: java.lang.ClassNotFoundException: org.osgi.framework.Version
      	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
      	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
      	... 22 more
      

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: