Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-11668

OSGI: Self-imported package causes failure upon Karaf restart

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 2.7
    • None
    • osgi
    • Ignite 2.7

      Apache Karaf 4.2.0

    Description

      I've got problem using Ignite 2.7 in Apache Karaf 4.2.0. The problem is caused by strange bundle meta of ignite-osgi. It exports package org.apache.ignite.osgi.classloaders and imports it at the same time. Here's extract from METADATA.MF:

      Import-Package: org.apache.ignite;version="[2.7,3)",org.apache.ignite.
      configuration;version="[2.7,3)",org.apache.ignite.internal.util;versi
      on="[2.7,3)",org.apache.ignite.internal.util.tostring;version="[2.7,3
      )",org.apache.ignite.internal.util.typedef.internal;version="[2.7,3)"
      ,org.apache.ignite.osgi.classloaders,org.osgi.framework;version="[1.7
      ,2)"
      Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
      Fragment-Host: org.apache.ignite.ignite-core
      Export-Package: org.apache.ignite.osgi.classloaders;uses:="org.apache.
      ignite.internal.util.tostring,org.osgi.framework";version="2.7.0",org
      .apache.ignite.osgi;uses:="org.apache.ignite,org.apache.ignite.config
      uration,org.apache.ignite.osgi.classloaders,org.osgi.framework";versi
      on="2.7.0"
      

      There is no problem with initial installation of my application into Karaf, although after Karaf ignite-osgi dependency is not resolved, and this exception in log:

      org.osgi.framework.BundleException: Unable to resolve graphql-core [399](R 399.0): missing requirement [graphql-core [399](R 399.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.ignite.osgi.classloaders)(version>=2.7.0)(!(version>=3.0.0))) [caused by: Unable to resolve org.apache.ignite.ignite-osgi [432](R 432.0): missing requirement [org.apache.ignite.ignite-osgi [432](R 432.0)] osgi.wiring.host; (&(osgi.wiring.host=org.apache.ignite.ignite-core)(bundle-version>=0.0.0))] Unresolved requirements: [[graphql-core [399](R 399.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.ignite.osgi.classloaders)(version>=2.7.0)(!(version>=3.0.0)))]
      
      

      Proposed solution:
      remove the self-import by adding instruction to bundle plugin configuration in modules/osgi/pom.xml

      <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <configuration>
              <instructions>
                  <Fragment-Host>org.apache.ignite.ignite-core</Fragment-Host>
                  <Import-Package>!org.apache.ignite.osgi.classloaders,*</Import-Package>
              </instructions>
          </configuration>
      </plugin>
      

      Attachments

        Issue Links

          Activity

            People

              olemogyl Oleksii Mohylin
              olemogyl Oleksii Mohylin
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m