Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Gemini Simple ManagedService
Gemini Simple ManagedService [message #730710] Thu, 29 September 2011 00:04 Go to next message
Branden Visser is currently offline Branden VisserFriend
Messages: 5
Registered: September 2011
Junior Member
Hi everyone,

I was just going through the Compendium Services documentation, hoping to get some configuration working for my OSGi bundle. I have a pretty simple mission objective right now: Configure my DBCP data-source using the Apache Felix Configuration Manager.

So, I configure my cm-properties like so:

<osgix:cm-properties id="dataSource-props" persistent-id="ca.mrvisser.dynamicdb.dataSource">
	<prop key="driverClassName">com.mysql.jdbc.Driver</prop>
	<prop key="url">jdbc:mysql://localhost/ddb</prop>
	<prop key="username">ddb</prop>
	<prop key="password">ddb</prop>
</osgix:cm-properties>


And then my dataSource bean is declared:

<bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
	<osgix:managed-properties persistent-id="ca.mrvisser.dynamicdb.dataSource" />
</bean>


When I deploy this, there are no issues starting up the bundle or the application context. The exported services includes:

Service ID 236	Types: org.osgi.service.cm.ManagedService
Service PID: ca.mrvisser.dynamicdb.dataSource


So it looks like it picked up the managed service, but it just didn't get into Apache Felix' "Configuration" tab. Did I miss a step?

These are some noteable bundle versions (let me know if you need more):

System Bundle: v3.0.8
Apache Felix Configuration Admin Service: v1.2.8 (looks to be the latest version on Apache Felix site?)

Might also be noteworthy that I'm running a bundled Apache Sling container.

Any help is much appreciated!


Re: Gemini Simple ManagedService [message #730715 is a reply to message #730710] Thu, 29 September 2011 00:52 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
<osgix:cm-properties id="dataSource-props" persistent-id="ca.mrvisser.dynamicdb.dataSource">


This defines a "consumer" of the configuration. So you are saying that if there is anything for "ca.mrvisser.dynamicdb.dataSource" - please give it to me.

<prop key="driverClassName">com.mysql.jdbc.Driver</prop>
	<prop key="url">jdbc:mysql://localhost/ddb</prop>
	<prop key="username">ddb</prop>
	<prop key="password">ddb</prop>


This says that in case there isn't anything out there - use provided properties as default.

I am not 100% sure now how Sling manages ConfigurationAdmin specific configs, but there should be a way to drop a .cfg or a .property file somewhere and have it consumed. You can do it with Felix File Install component

Hope this helps.

Dmitry

[Updated on: Thu, 29 September 2011 00:52]

Report message to a moderator

Re: Gemini Simple ManagedService [message #730722 is a reply to message #730715] Thu, 29 September 2011 01:51 Go to previous messageGo to next message
Branden Visser is currently offline Branden VisserFriend
Messages: 5
Registered: September 2011
Junior Member
Ahh, yes that makes it clear Dmitry, thanks for your reply. I'll continue searching for a way to actually deliver "external values" to the configuration, and I think File Install might be a good start!
Re: Gemini Simple ManagedService [message #730733 is a reply to message #730722] Thu, 29 September 2011 02:55 Go to previous message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
You might also give Virgo a try Smile http://www.eclipse.org/virgo/
Virgo is able to deploy both simple and factory configurations also.
Previous Topic:Gemini DBAccess for MySQL
Next Topic:Gemini JPA: Can not get Weaving Hook working
Goto Forum:
  


Current Time: Thu Apr 25 22:58:33 GMT 2024

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

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

Back to the top