karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steinar Bang ...@dod.no>
Subject Re: Adding an @Activate to a DS bundle causes the bundle not to load
Date Tue, 05 Dec 2017 15:52:08 GMT
>>>>> Christian Schneider <chris@die-schneider.net>:

> The requirement
> osgi.service; effective:=active; filter:="(objectClass=org.osgi.service.jdbc.DataSourceFactory)
> expresses that your bundle needs a service of this type. The resolver
> then checks if any other bundle in your feature:install provides the
> capabiltiy.  It is not actually checking if the service is created. It
> just works on requirement / capability level.

> In karaf you can define the Provide-Capability in a feature. If you do
> this in your own feature then you can kind of negate the requirement
> that is added to your bundle.

> The better way to handle this is to make the bundle that provides the
> DataSourceFactory provide the capability or to let the feature that
> loads this bundle provide the capability.

Thanks!

I've looked at the manifest.mf of both my current version of the
PostgreSQL JDBC driver and tne newest version on maven central[1]
and neither of them contains the text "provide".

(side note: for why the version number suddenly changed from "9" to "42", see[2])

So for now I have the following plan:
 1. Add the workaround stuff to my feature so that it will work with the
    current version of the PostgreSQL JDBC driver
 2. Open an issue for the the missing header in the PostgreSQL JDBC
    driver issue tracker[3]
 3. Create a pull request with the appropriate maven-bundle-plugin
    changes and send that to the maintainers


References:
[1] <https://mvnrepository.com/artifact/org.postgresql/postgresql/42.1.4>
[2] <https://jdbc.postgresql.org/documentation/faq.html#versioning>
[3] <https://github.com/pgjdbc/pgjdbc/issues>



Mime
View raw message