Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » config admin service seems not to launch !?
config admin service seems not to launch !? [message #493294] Sat, 24 October 2009 12:40 Go to next message
thomas menzel is currently offline thomas menzelFriend
Messages: 81
Registered: July 2009
Member
hi,

i'm racking my brains and searching google for half a day now on getting a simple bundle working with the config admin but it seems that the config admin isnt launched. what do i have todo that it does?

i believe i have included all need bundles:
0	ACTIVE      org.eclipse.osgi_3.5.0.v20090520
1	ACTIVE      org.apache.log4j_1.2.13.v200903072027
2	ACTIVE      org.eclipse.osgi.services_3.2.0.v20090520-1800
3	ACTIVE      javax.servlet_2.5.0.v200806031605
4	ACTIVE      org.eclipse.equinox.util_1.0.100.v20090520-1800
5	ACTIVE      org.eclipse.equinox.frameworkadmin_1.0.100.v20090520-1905
6	ACTIVE      org.eclipse.osgi.util_3.2.0.v20090520-1800
7	ACTIVE      org.eclipse.equinox.frameworkadmin.equinox_1.0.100.v20090520-1905
8	ACTIVE      javax.xml_1.3.4.v200806030440
9	ACTIVE      org.apache.commons.logging_1.1.1
10	ACTIVE      org.eclipse.equinox.common_3.5.0.v20090520-1800
11	ACTIVE      ConfigedBundle_1.0.0.qualifier
12	ACTIVE      org.eclipse.equinox.ds_1.1.0.v20090601


when i try to get an instance of the service like so (taken from turials and samples on the web) i get NULL!.

    ServiceReference caRef = bundleContext.getServiceReference(ConfigurationAdmin.class.getName());



i have a very simple ManagedService that registers itself like so in activate()

protected void activate(ComponentContext context) throws IOException {
    log(" // TODO: Do something on activation ");

    Dictionary properties = new Hashtable();
    properties.put("service.pid", PID_REGISTER_LOCATION_ACTIVATE);
    BundleContext bundleContext = context.getBundleContext();
    _registration =
      bundleContext.registerService(ManagedService.class.getName(), this, properties);

    logDictionary("activate(): properties", context.getProperties());


  }



if i understand the OSGi spec correctly, i just have to register my service with the MS interface and then ConfgiAdmin should kick in and call the update(Config method) on a separate thread, correct?

well, i have a break point in that method, it never comes up!

so, what's the trick?


thomas menzel aka tom

[Updated on: Sat, 24 October 2009 12:41]

Report message to a moderator

Re: config admin service seems not to launch !? [message #493316 is a reply to message #493294] Sat, 24 October 2009 18:02 Go to previous messageGo to next message
BJ Hargrave is currently offline BJ HargraveFriend
Messages: 60
Registered: July 2009
Member
Sounds like you are not wired to the same org.osgi.service.cm package as the ConfigAdmin bundle. If you do not share the same package, the framework will not return the service to you since you will get a ClassCastException when you cast it.
Re: config admin service seems not to launch !? [message #493331 is a reply to message #493316] Sat, 24 October 2009 22:12 Go to previous messageGo to next message
thomas menzel is currently offline thomas menzelFriend
Messages: 81
Registered: July 2009
Member
pardon my ignorance, but how can that happen? as far as i can tell i only have on bundle exporting org.osgi.service.cm, or do you mean diff. classloaders pointing to the same bundle?

when starting i have DS debugging on but dont see a CCE!?

FYI:
my service is brought up by DS and i'm using Import package and not require bundle.


so, could give me a few more pointers, what to do?

PS: if i may ask: in which equinox bundle lives the ConfigurationAdmin implementation? and what's its name?


thomas menzel aka tom

[Updated on: Sat, 24 October 2009 22:14]

Report message to a moderator

Re: config admin service seems not to launch !? [message #493339 is a reply to message #493331] Sun, 25 October 2009 00:51 Go to previous messageGo to next message
BJ Hargrave is currently offline BJ HargraveFriend
Messages: 60
Registered: July 2009
Member
Sorry, I was reading and replying from my phone, so I did not read fully. I assumed you actually had a ConfigAdmin implementation bundle actually installed. But you don't. You should probably install an implementation of ConfigAdmin if you want to use it. You seem to be importing the org.osgi.service.cm package from org.eclipse.osgi.services bundle which means you resolve successfully. But, of course, since you have no ConfigAdmin implementation bundle installed, you can't find a ConfigAdmin service in the service registry. You can download the Equinox ConfigAdmin implementation, org.eclipse.equinox.cm, from http://download.eclipse.org/equinox/drops/R-3.5.1-2009091708 00/index.php
Re: config admin service seems not to launch !? [message #493383 is a reply to message #493339] Sun, 25 October 2009 15:47 Go to previous message
thomas menzel is currently offline thomas menzelFriend
Messages: 81
Registered: July 2009
Member
as soon as u do it right, it works Wink

thx for the quick responses on a weekend!

PS: is that written somewhere in the documentation and i just didnt see/find, or do you just have to know?


thomas menzel aka tom
Previous Topic:p2 API feedback
Next Topic:RCP app wont update after upgrade to org.eclipse.rcp 3.5.1
Goto Forum:
  


Current Time: Fri Apr 26 22:30:16 GMT 2024

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

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

Back to the top