Trying to use DS with RCP [message #120584] |
Mon, 03 November 2008 12:01  |
Eclipse User |
|
|
|
Hi there,
IŽm trying to use declarative services in my RCP-Plugin.
The information on the net are very small.
Here is a developer with nearly the same
problem( http://osdir.com/ml/ide.eclipse.equinox.devel/2007-11/msg001 02.html).
For clear understanding, is it necessary to modify the config.ini?
I found a video-tutorial on Eclipse.live
(http://live.eclipse.org/node/501) but heŽs also using the OSGI-console.
I think this is the solution(like in the video)
// Create and open a tracker for the log service
ServiceTracker logTracker = new ServiceTracker(bc,
LogService.class.getname(), null);
logTracker.open();
// use the service
((LogService)logTracker.getService()).log(LogService.LOG_INF O,
"message"));
But when running the code, i get a nullpointer using the service.
My RCP-code runs very well without the code above, so the exception
depends on using the service.
IŽm happy on every tutorial or hint.
Thanks,
Moritz
|
|
|
|
|
Re: Trying to use DS with RCP [message #120663 is a reply to message #120635] |
Tue, 04 November 2008 06:14  |
Eclipse User |
|
|
|
You need to change osgi.bundles property defined in your config.ini and
append the org.eclipse.equinox.log bundle with @start parameter. This
will install and activate the LogService.
moritz wrote:
> Sorry, wrong understanding.
>
> It was only an example on using services, or how i think to use a service.
>
> But you said i should start the service. How can i start sevice using
> rcp-plugins?
>
> thanks mo
>
|
|
|
Powered by
FUDForum. Page generated in 0.03483 seconds