Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4640

missing (&(osgi.ee=JavaSE)(version=1.8)) when embedding in org.apache.felix.framework

    XMLWordPrintableJSON

Details

    Description

      When I try to deploy a bundle from a OBRepo occur the below error 'Unsatisfied requirement'.

      g! obr:deploy any.bundle

      Unsatisfied requirement(s):
      ---------------------------
      (&(osgi.ee=JavaSE)(version=1.8))

      I would expect that this capability will be provided by system-bundle.

      g! felix:inspect capability osgi.ee
      org.apache.felix.framework [0] provides:
      ----------------------------------------
      osgi.ee; OSGi/Minimum [1.0.0, 1.1.0, 1.2.0] [UNUSED]
      osgi.ee; JavaSE [1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0]

      My full runtime environment is.

      g! lb
      START LEVEL 1
      ID|State |Level|Name
      0|Active | 0|System Bundle (4.4.0)
      1|Active | 1|Apache Felix Bundle Repository (2.0.2)
      2|Active | 1|bndlib (2.3.0.201405100607)
      3|Active | 1|biz.aQute.repository (2.1.0.062515_230REL)
      4|Active | 1|Java XML Streaming API (1.0.1.v201004272200)
      5|Active | 1|JAXP XML (1.3.4.v201005080400)
      6|Active | 1|Apache Felix Gogo Command (0.14.0)
      7|Active | 1|Apache Felix Gogo Runtime (0.12.1)
      8|Active | 1|Apache Felix Gogo Shell (0.10.0.v201212101605)

      I found one related fact in 'org.apache.felix.bundlerepository-2.0.2/org.apache.felix.bundlerepository.impl.LocalResourceImpl.java'.

      • declared 'osgi.ee' capabilities from framework-bundle will realized as 'ee=JavaSE-1.8' capability
      • but the filter require 1 spitted capability (<java-ee-name> and <java-ee-version>) '(&(osgi.ee=JavaSE)(version=1.8))'

      Here the patch who works for me.
      85c85,86
      < cap.addProperty(Capability.EXECUTIONENVIRONMENT, tokens.nextToken().trim());

      > String eeValue = tokens.nextToken().trim();
      > cap.addProperty(Capability.EXECUTIONENVIRONMENT, eeValue);
      86a88,100
      >
      > String[] split = eeValue.split("-");
      > switch (split.length) {
      > case 2:
      > String osgi_ee = "osgi." + Capability.EXECUTIONENVIRONMENT;
      > CapabilityImpl cap2 = new CapabilityImpl(osgi_ee, new PropertyImpl[]

      { > new PropertyImpl(osgi_ee, null, split[0]), > new PropertyImpl("version", null, split[1]) > }

      );
      > addCapability(cap2);
      > break;
      > }

      Attachments

        1. cap.diff
          2 kB
          David Bosschaert

        Activity

          People

            bosschaert David Bosschaert
            jwausle Jan Winter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: