Indeed all dependencies (JDBC driver, Connection pool etc) first needed to
be resolved before the service appeared. Although the log - on default log
level - didn't state any messages concerning missing dependencies.

Thanks for the clarification.


On Tue, Feb 4, 2014 at 5:28 AM, Jean-Baptiste Onofré <[email protected]>wrote:

> Hi Richard,
>
> As Christian said, it works. The jdbc:create command is just for
> convenience. The jdbc:datasources is lookup for all javax.sql.DataSource
> services.
>
> You have probably an issue at deployment. Did you check in the karaf.log ?
>
> Regards
> JB
>
>
> On 02/03/2014 04:44 PM, Richard Kettelerij wrote:
>
>> 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 <http://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
>>
>>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Reply via email to