UserAdmin osgi service inacessible [message #753427] |
Thu, 27 October 2011 08:28 |
Eclipse User |
|
|
|
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 #753495 is a reply to message #753480] |
Thu, 27 October 2011 13:36 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04779 seconds