Hello,

I'm using Apache Felix in an embedded fashion.  I'm attempting to access
my own bundle repository so I install and start the bundle repository
bundle like so:

        // install the Felix OBR bundle
        Bundle obrBundle = null;
        try {
            obrBundle =
m_felix.getBundleContext().installBundle("file:/home/tim/workspace/clojure/lambdaprime/metascrape-ui/lib/org.apache.felix.bundlerepository-2.0.2.jar");
        } catch (BundleException e) {
            System.err.println("Error installing Felix OBR bundle.");
            e.printStackTrace();
        }

        // start the Felix OBR bundle
        if (obrBundle != null) {
            try {
                obrBundle.start();
            } catch (BundleException e) {
                System.err.println("Could not start Felix OBR bundle.");
                e.printStackTrace();
            }
        }

I have a private method to get a RepositoryAdmin:

    private static RepositoryAdmin getRepositoryAdmin(BundleContext ctx) {
        ServiceReference ref =
ctx.getServiceReference(RepositoryAdmin.class.getName());
        if (ref != null) {
            return (RepositoryAdmin)ctx.getService(ref);
        }
        return null;
    }

But when this method is called, I get the following exception:

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

I'm using felix.jar from the bin directory of of the 4.4.1 distribution
and using org.apache.felix.bundlerepository-2.0.2.jar for the bundle
repository.  Any ideas what my issue is?

By the way, is there javadoc for Felix?  I can't seem to find any.

Thanks,
Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to