You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Jan Winter (JIRA)" <ji...@apache.org> on 2015/01/16 14:41:34 UTC

[jira] [Created] (FELIX-4765) RepositoryAdmin don´t discover my required resources.

Jan Winter created FELIX-4765:
---------------------------------

             Summary: RepositoryAdmin don´t discover my required resources.
                 Key: FELIX-4765
                 URL: https://issues.apache.org/jira/browse/FELIX-4765
             Project: Felix
          Issue Type: Bug
          Components: Bundle Repository (OBR)
    Affects Versions: bundlerepository-2.0.2
            Reporter: Jan Winter
            Priority: Minor


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 

<code>
		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));
			}
		}
</code>

Than I got no results for any requirement.

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

<pre>
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>
</pre>

Than I got results.

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




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)