Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Unresolved dependency on com.sun.security.auth
Unresolved dependency on com.sun.security.auth [message #695766] Tue, 12 July 2011 14:05 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Hello everybody.

One of my bundles has a dependency on package com.sun.security.auth. When I try to install the bundle into Virgo, this Import-Package dependency cannot be resolved.

I understand this is due to the fact that com.sun.security.auth does not get packaged with the standard Java. Is this correct? And if so, how do I go about resolving the issue?

I have not been able to find an OSGi-fied version of this on the web.

TIA<
B.
Re: Unresolved dependency on com.sun.security.auth [message #695775 is a reply to message #695766] Tue, 12 July 2011 14:23 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
You're probably right that com.sun.security.auth is not provided with standard Java.

By default, lib/java6-server.profile includes the pattern com.sun.* in the org.osgi.framework.bootdelegation property, so Equinox will delegate class loads for com.sun.security.auth to the system class loader. So you could add a JAR containing the package to your JRE's class path and make sure the bundles that need that package do not import the package.

Alternatively, you could add a JAR containing the package to your JRE's class path and then make it available as an export from the system bundle by editing the org.osgi.framework.system.packages property in lib/java6-server.profile. But then you'd need to monkey about with the org.osgi.framework.bootdelegation property and it might be tricky to specify the com.sun packages that really need to be boot delegated while excluding com.sun.security.auth from being boot delegated.

Alternatively, it may be possible to create a bundle containing the package. But again you'd need to monkey with the boot delegation property to avoid the class loads being boot delegated.

Hope that helps!
Re: Unresolved dependency on com.sun.security.auth [message #695780 is a reply to message #695775] Tue, 12 July 2011 14:37 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Thanks Glyn!

Interestingly, your option no.2 was already recommended in a more general, container agnostic, context in a post I found on the web.

I will try out your ideas and see which one works with the least pain! Cool

As for option no. 1, I have bundlor manage imports/exports declaration in the MANIFEST.MF file. How would I go about persuading Bundlor not to add that specific package to the list of imports?
Re: Unresolved dependency on com.sun.security.auth [message #695787 is a reply to message #695780] Tue, 12 July 2011 14:45 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
I think you can use Bundlor's Excluded-Imports template header.
Re: Unresolved dependency on com.sun.security.auth [message #695796 is a reply to message #695787] Tue, 12 July 2011 15:04 Go to previous messageGo to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Option 1, with the Bundlor's template change you suggested, works like a charm, thanks!
Re: Unresolved dependency on com.sun.security.auth [message #695805 is a reply to message #695796] Tue, 12 July 2011 15:06 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Good to hear. I'm glad the monkeying around was unnecessary!
Previous Topic:classpath for several bundles
Next Topic:Dump Inspector problem
Goto Forum:
  


Current Time: Mon Dec 22 09:22:13 GMT 2014

Powered by FUDForum. Page generated in 0.01784 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software