Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » EventAdmin ServiceReference is always null?
EventAdmin ServiceReference is always null? [message #66621] Fri, 12 May 2006 13:33 Go to next message
Cameron Ross is currently offline Cameron RossFriend
Messages: 17
Registered: July 2009
Junior Member
Hello,

I am unable to obtain a valid ServiceReference for the EventAdmin service
shipped with 3.2RC3. The start method in my Activator class looks like
this:

public void start(BundleContext context) throws Exception {
ServiceReference serviceRef =
context.getServiceReference(EventAdmin.class.getName());
// serviceRef is always null!
}

The following items are selected in both the Eclipse
"Window->Preferences->Plug-in Development->Target Platform->Plug-ins" and
"Run->Run...->Plug-ins->Target Platform" areas:
- org.eclipse.equinox.log(1.0.0.v20060206)
- org.eclipse.osgi(3.2.0.v20060505)
- org.eclipse.osgi.services(3.1.100.20060426)

My manifest contains the following header and everything compiles nicely:
Import-Package: org.osgi.framework, org.osgi.service.event,
org.osgi.util.tracker

I'm running Eclipse 3.2-RC3 (Version 3.2.0, Build ID I20060505-1306) with
Sun's JRE 1.5.0_06 on Windows XP Professional SP2.

Note that I am able to get a ServiceReference to the LogService. Any help
is greatly appreciated.

Thanks,
Cameron Ross.
Re: EventAdmin ServiceReference is always null? [message #68019 is a reply to message #66621] Wed, 24 May 2006 18:43 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
You need to include the org.eclipse.equinox.event bundle in your target.
You can get the optional service bundle implementations from the
equinox download site at.

http://download.eclipse.org/eclipse/equinox/

You can download each bundle individually or the equinox feature which
includes most of the equinox bundles (notice that
org.eclipse.equinox.ds) is currently not included in the feature.

When you use the org.eclipse.equinox.event bundle make sure it is
started so that it can register the EventAdmin service you need.

Tom.
Previous Topic:Luanching server OSGI during development
Next Topic:Obtaining a bundle as bytes
Goto Forum:
  


Current Time: Mon Dec 30 16:52:53 GMT 2024

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

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

Back to the top