On 14/11/2007, Damien Lecan <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Severals weeks ago I had a problem with javax.* packages imported by my
> bundle.
> I added <Import-Package>!javax.*,*</Import-Package> to solve my problem.
>
>
> For another bundle, I did the same thing, but these imported packages
> appear in export-package too via "uses:" instruction !
>
> Ex :
>   Export-Package: my.package;uses:="javax.management,javax.net.ssl"
>
> I have looked at Bnd doc, but I haven'n't find anything to solve my
> problem.
> How to remove this "uses" instruction ?


the uses clause helps avoid class space problems by ensuring that a package
and
any packages it uses are in the same class space - afaik it isn't possible
to turn off
this feature of Bnd

however, rather than trying to pretend that your exported packages don't
depend
on those javax packages, why not just mark them as optional instead of
removing
them from the imports, ie:

   <Import-Package>javax.*;resolution:=optional, *</Import-Package>

that way you could still install and start your bundle even if these
packages weren't
available - it's just that you'd get an exception at runtime if something in
the bundle
tried to load them

otherwise even if you removed the packages from the uses list, you would
probably
find you had problems using the bundle on systems without those packages,
and it
could be tricky to diagnose (as like all classloader issues)

btw - most OSGi frameworks (such as Felix) let you export javax.* packages
from the
system bundle, or (as a last resort) you could even set the bootdelegation
to expose
them via the main classloader (though using bootdelegation means you can't
replace
or have multiple versions of javax.* packages)

Thanks
>
> Damien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Cheers, Stuart

Reply via email to