Search code examples
apacheosgiobrbundle

Apache Felix Bundle Repository - Calling from another bundle


I have a simple test program which is designed to consume the Apache Felix Bundle Repository bundle service however I am having trouble configuring it through eclipse.

I am using the jar for the bundle (org.apache.felix.bundlerepository-1.4.0.jar) as an referenced library and have added it to the classpath in the manifest.

When I try to start my bundle it gives the error:

java.lang.ClassCastException: org.apache.felix.bundlerepository.RepositoryAdminImpl cannot be cast to org.apache.felix.bundlerepository.RepositoryAdmin

I can't add org.osgi.service.obr to the list of imported packages in my bundle (as it doesnt resolve) and I think this is the reason for the issue.

Any ideas?

Thanks


Solution

  • This was resolved by including the Apache Felix Bundle Repository bundle (org.apache.felix.bundlerepository-1.4.0.jar) in the eclipse/plugins folder which allowed me to reference the org.osgi.service.obr package in the list of imported packages in the manifest.