You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Milan Tomic <to...@yahoo.com> on 2015/02/03 14:13:52 UTC
org.osgi.compendium + H2 + PAX-EXAM + Karaf
Hi,
In my PAX-EXAM tests I have:
the problem is that if I don't add org.osgi.compendium bundle:
return CoreOptions.options(...wrappedBundle(mavenBundle().groupId("com.h2database").artifactId("h2").version("1.3.176")).start(),
...)
then in logs I see exception that h2 bundle requires org.osgi.compendium (because of JDBC...). If I include org.osgi.compendium bundle:
return CoreOptions.options(...wrappedBundle(mavenBundle().groupId("com.h2database").artifactId("h2").version("1.3.176")).start(),
mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version("5.0.0").start(),
...)
then Karaf which runs on JUnit/PAX-EXAM acts strange: for example, there is no "bundle:list" command (it dissapear).
When I run standalone Karaf with same settings (I add org.osgi.compendium in my .kar file) everything works fine.
Thank you in advance for any hint,Milan
Re: org.osgi.compendium + H2 + PAX-EXAM + Karaf
Posted by Christian Schneider <ch...@die-schneider.net>.
Not sure about you case here (seems to use another h2 version) but we
test using h2 in pax-jdbc and it works well.
One example is this test:
https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-karaf-itest/src/test/java/org/ops4j/pax/jdbc/test/PaxJdbcPoolTest.java
It installs h2 using the feature from pax-jdbc. As you can see we did
not need to install org.osgi.compendium. Normally these packages are
provided by the framework.
The only package we needed to provide was org.osgi.service.jdbc for the
DataSourceFactory.
Christian
On 03.02.2015 14:13, Milan Tomic wrote:
> Hi,
>
> In my PAX-EXAM tests I have:
>
> the problem is that if I don't add org.osgi.compendium bundle:
>
> return CoreOptions.options(...
> wrappedBundle(mavenBundle().groupId("com.h2database").artifactId("h2").version("1.3.176")).start(),
> ...)
>
> then in logs I see exception that h2 bundle requires
> org.osgi.compendium (because of JDBC...). If I
> include org.osgi.compendium bundle:
>
> return CoreOptions.options(...
> wrappedBundle(mavenBundle().groupId("com.h2database").artifactId("h2").version("1.3.176")).start(),
> mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version("5.0.0").start(),
> ...)
>
> then Karaf which runs on JUnit/PAX-EXAM acts strange: for example,
> there is no "bundle:list" command (it dissapear).
>
> When I run standalone Karaf with same settings (I add
> org.osgi.compendium in my .kar file) everything works fine.
>
> Thank you in advance for any hint,
> Milan
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com