With regard to accessing databases in Karaf the overal recommended way
seems to be to declare a javax.sql.Datasource in Blueprint and expose it as
a OSGi service so other bundles can make use of it.

This is easily done by placing the blueprint file in the /deploy directory
as described by Christian on [1]. Unfortunately this doesn't work for me
with Karaf 2.3.3. While the blueprint bundle is loaded correctly is doesn't
seem to expose any service properties. My "osgi.jndi.service.name" property
isn't available in the service registry, hence other bundles can't find the
datasource.

I've check this by calling 'ls <id of blueprint datasource bundle>' in the
shell. This doesn't return any results.

PS: I know about the new JDBC commands in Karaf 3.0 (and Karaf 2.3.4
hopefully soon) but this is also suppose to work right?

Regards,
Richard

[1]
http://www.liquid-reality.de/display/liquid/2012/01/13/Apache+Karaf+Tutorial+Part+6+-+Database+Access

Reply via email to