Your code samples have been removed from your email again, and I'm not sure what else might be missing.
However, I notice one obvious error. The package is exported by Bundle B, and you are trying to import it in Bundle A and Bundle C.... however, Bundle A is the system bundle. It is impossible for the system bundle to import packages from ordinary bundles. Instead, you need to export the package from the system bundle using the "org.osgi.framework.system.packages.extra" configuration property. At that going, Bundle B becomes redundant (unless it has other useful exports). You could try switching to Equinox; you'll get exactly the same problem of course :-) Neil On Tue, May 7, 2013 at 4:17 PM, Roland <[email protected]> wrote: > ClassCastException - not again! > > Hello everyone, > after hours of investigation of my problem i resign. > > I embedded Apache Felix 4.3 to my host application, i use the maven blugin > to build my project and i have 3 bundles. > > Bundle A (systembundle) > Bundle B (exports a interface) > Bundle C (implements this interface) > > Bundle C imports the interface and registers the implementation of the > interface as a service. > Bundle A imports the interface and uses this service. > > In the activator method of the systembundle (A) i have following code > snippets. > > > > I get a ClassCastException after isAssignableTo(). > > I checked if the interface and the implementation are fully separated. > The imports and exports of (A,B,C) are correct. > The classloaders are the same, namely the classloader of the bundle which > exports the interface (B). > I checked if the interface-package is imbedded to other bundles, but it > exist only one version in (B). > I checked if i'm inside or outside of OSGi. I'm definitly inside of OSGi. > > Have someone an idea whats going wrong? What else can I check? > Maybe a switch to Equinox might help. Should I? > > > Thank you so much so far. > regards > Roland > > > > -- > View this message in context: > http://apache-felix.18485.x6.nabble.com/ClassCastException-after-isAssignableTo-tp5003252.html > Sent from the Apache Felix - Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

