Skip to main content



      Home
Home » Eclipse Projects » Equinox » Trying to use DS with RCP
Trying to use DS with RCP [message #120584] Mon, 03 November 2008 12:01 Go to next message
Eclipse UserFriend
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 #120622 is a reply to message #120584] Tue, 04 November 2008 03:09 Go to previous messageGo to next message
Eclipse UserFriend
You need to install org.eclipse.equinox.log bundle and start it. That's
why you get NPE when trying to access the log service.


moritz Bornwasser wrote:
> 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 #120635 is a reply to message #120622] Tue, 04 November 2008 05:30 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Trying to use DS with RCP [message #120663 is a reply to message #120635] Tue, 04 November 2008 06:14 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:p2 director cannot update previously installed product
Next Topic:p2-self provisioning into emty folder or assembled product?
Goto Forum:
  


Current Time: Thu May 08 19:59:07 EDT 2025

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

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

Back to the top