HikariCP and OSGi

413 views
Skip to first unread message

Luca Burgazzoli

unread,
Jan 6, 2014, 9:58:27 AM1/6/14
to hika...@googlegroups.com
Hi,
I'm testing HikariCP in an OSGi environment and I found that even it is a proper OSGi bundle it fails to discover JDBC drivers.
This is "ok" because the header does not import any jdbc driver (right):

karaf@jpa()> bundle:headers 193

HikariCP (193)
--------------
Manifest-Version = 1.0
Bnd-LastModified = 1388924968544
Tool = Bnd-1.50.0
Built-By = brettw
Build-Jdk = 1.7.0_07
Created-By = Apache Maven Bundle Plugin

Bundle-Vendor = Zaxxer.com
Bundle-Name = HikariCP
Bundle-Description = Ultimate JDBC Connection Pool
Bundle-SymbolicName = com.zaxxer.HikariCP
Bundle-Version = 1.2.2
Bundle-ManifestVersion = 2

Import-Package =
com.sun.tools.attach,
javassist;version="[3.18,4)",
javassist.bytecode;version="[3.18,4)",
javassist.bytecode.annotation;version="[3.18,4)",
javax.management,
javax.sql,
javax.sql.rowset,
javax.sql.rowset.serial,
javax.sql.rowset.spi,
org.slf4j;version="[1.7,2)"
Export-Package =
com.zaxxer.hikari;uses:="org.slf4j,javax.sql,javax.management";version=1.2.2


Do you know any better solution than adding DynamicImport-Package: * to the bundle's manifest?

Thx,
Luca

Brett Wooldridge

unread,
Jan 6, 2014, 7:17:15 PM1/6/14
to hika...@googlegroups.com
Hi Luca,

Thanks for reporting this.  There is no viable alternative to DynamicImport-Package: * in OSGi.  Other options such as "registered buddies" would only work if the bundle containing the JDBC driver had a header referencing the HikariCP bundle, and such a solution would be specific to Equinox OSGi.  I'll fix the OSGi header, the change will be on the dev branch within the hour, and will be included in the next release.

Reply all
Reply to author
Forward
0 new messages