Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Trying to use DS with RCP
Trying to use DS with RCP [message #120584] Mon, 03 November 2008 17:01 Go to next message
moritz is currently offline moritzFriend
Messages: 2
Registered: July 2009
Junior Member
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 08:09 Go to previous messageGo to next message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
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 10:30 Go to previous messageGo to next message
moritz is currently offline moritzFriend
Messages: 2
Registered: July 2009
Junior Member
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 11:14 Go to previous message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
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 Apr 25 13:32:15 GMT 2024

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

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

Back to the top