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

RepositoryAdmin don´t discover my required resources.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: bundlerepository-2.0.2
    • Fix Version/s: None
    • Labels:
      None

      Description

      I use 'org.apache.felix.bundlerepository-2.0.2.jar'

      I register a index.xml (@see attachement index.xml)

      • generated by 'org.osgi.impl.bundle.repoindex.lib-2.1.1.jar'
      • with content:
        bundle.1 `export` bundle.1.requieredpackage
        bundle.2
        bundle.3 `requiere` bundle.2
        bundle.3 `import` bundle.1.requieredpackage

      If I try to discover the requirements of bundle.3

      		Resource[] discoverResources = this.repositoryAdmin.discoverResources("(symbolicname=bundle.3)");
      		for (Resource resource : discoverResources) {
      			System.out.printf("Resources: %s. Require:\n", resource.getSymbolicName());
      			
      			for (final Requirement requirement : resource.getRequirements()) {
      				Resource[] dependencies = this.repositoryAdmin.discoverResources(new Requirement[] { requirement });
      				
      				System.out.printf("\t%s: %s\n", requirement, Arrays.toString(dependencies));
      			}
      		}
      

      Than I got no results for any requirement.

      I patch my index.xml file like this (@see attached index.xml.patch):

      50a51,54
      >     <capability namespace="osgi.wiring.bundle">
      >       <attribute name="bundle" value="bundle.2"/>
      >       <attribute name="bundle-version" type="Version" value="1.0"/>
      >     </capability>
      85a90,95
      >     <capability namespace="osgi.wiring.package">
      >       <attribute name="package" value="bundle.1.requiredpackage"/>
      >       <attribute name="version" type="Version" value="0.0.0"/>
      >       <attribute name="bundle-symbolic-name" value="bundle.1"/>
      >       <attribute name="bundle-version" type="Version" value="1.0"/>
      >     </capability>
      

      Than I got results.

      Anything goes wrong while bindex.xml-generation or repoadmin-discovering.

        Attachments

        1. index.xml.patched
          5 kB
          Jan Winter
        2. index.xml
          4 kB
          Jan Winter
        3. CapabilityDuplicator.java
          2 kB
          Jan Winter

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jwausle Jan Winter
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: