2009/8/13 Dmitry Skavish <[email protected]>

> Hi,
> So I have this case when I have two (or more) bundles exporting the same
> package, but different classes in them and I have another bundle which is
> importing classes from this package. The problem is that I am getting an
> error saying that some classes could not be found, i.e. classes from this
> common package. It seems as though the importing is possible only from one
> of the bundles. Importing the same package in those bundles in a manifest
> does not help.
>

[ note this isn't specific to Guice, it's a general OSGi issue ]

In OSGi this is called a "split" package situation, because the package
content is split across several bundles.

The general advice is to avoid split packages where possible, because they
make your application less modular,
but if this isn't possible then you can use Require-Bundle (ie. a bundle
dependency) instead of Import-Package:

  Require-Bundle: my.bundle.one, my.bundle.two, ...

which will then let your bundle access all packages exported by the listed
bundles - unlike Import-Package this
means you can get a package from more than one bundle, the downside is you
now have explicit dependencies
to the named bundles (i.e. I can't swap them out and replace them with
different bundles, even if they exported
the same content, because the dependency is on the name not the packages)

HTH

I am using google guice and basically the error is originated in guice when
> it tries to inject one of those imported classes. I am suspecting that it
> has something to do with it, probably proxies guice creates or something
> like that.
>
> Does anybody know what I am talking about here? Any solutions? Bridge
> classloaders maybe?
>
> Thanks!
>
> --
> Dmitry Skavish
>
> >

-- 
Cheers, Stuart

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to