Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » UserAdmin osgi service inacessible
UserAdmin osgi service inacessible [message #753427] Thu, 27 October 2011 08:28 Go to next message
Eclipse UserFriend
I would like to use the UserAdmin OSGi service available in equinox 3.7. I have added the following dependency in the MANIFEST.mf file: org.eclipse.equinox.useradmin;bundle-version="1.1.300".

I try to retrieve the OSGi service with the following code:
BundleContext ctx = FrameworkUtil.getBundle(Maclasse.class).getBundleContext();
ServiceReference<UserAdmin> ref2 = ctx.getServiceReference(UserAdmin.class);
UserAdmin userAdmin = ctx.getService(ref2);

But ref2 is always equal to NULL.

When I execute the status command under the OSGi console, I get the following message:
.....
449 reference:file:plugins/org.eclipse.equinox.useradmin_1.1.300.v20110413.jar
ACTIVE org.eclipse.equinox.useradmin_1.1.300.v20110413
.....
{org.osgi.service.useradmin.UserAdmin}={service.description=OSGi User Admin service - IBM Implementation,

service.pid=org.eclipse.equinox.internal.useradmin.Activator, service.vendor=IBM, service.id=369}

So it seems that the service is actually active and available in the OSGi context.

Have you any idea about this problem?
Re: UserAdmin osgi service inacessible [message #753480 is a reply to message #753427] Thu, 27 October 2011 12:43 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Is the equinox.ds bundle started in your RCP app? Is the OSGi console available already in the case where getService(ref2) returns null?

PW


Re: UserAdmin osgi service inacessible [message #753495 is a reply to message #753480] Thu, 27 October 2011 13:36 Go to previous message
Eclipse UserFriend
yes, i have this in my console :

With status command under osgi console :

87 reference:file:plugins/org.eclipse.equinox.ds_1.3.0.v20110502.jar
ACTIVE org.eclipse.equinox.ds_1.3.0.v20110502

Is the OSGi console available already in the case where getService(ref2) returns null?
Yes

I test this :

BundleContext ctx = FrameworkUtil.getBundle(Maclasse.class).getBundleContext();
ServiceReference<?> test = context.getServiceReference(EventAdmin.class.getName());

and ctx return service for EventAdmin
Previous Topic:Dependency Injection: clarification needed
Next Topic:messages_de_DE.properties cannot be load
Goto Forum:
  


Current Time: Thu Apr 25 10:49:53 GMT 2024

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

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

Back to the top