Platform: Windows 10,
Oracle java 1.8,
Karaf 4.1.1
pax-jdbc 1.0.1
pax-jdbc-derby 1.0.1
I'm debugging some startup problems in a pax exam test using the karaf
container.
One possible culprit now is this stack trace in the karaf.log:
2017-07-07T20:48:43,702 | ERROR | pool-3-thread-1 | test
| 55 - no.priv.bang.ukelonn.db.test - 1.0.0.SNAPSHOT | Derby mock
database failed to create connection
java.sql.SQLException: not supported - use a driver adapter
org.ops4j.pax.jdbc.<subprotocol>
at
org.ops4j.pax.jdbc.impl.DriverDataSourceFactory.createConnectionPoolDataSource(DriverDataSourceFactory.java:47)
~[?:?]
at
no.priv.bang.ukelonn.bundle.db.test.UkelonnDatabaseProvider.createConnection(UkelonnDatabaseProvider.java:58)
~[?:?]
at
no.priv.bang.ukelonn.bundle.db.test.UkelonnDatabaseProvider.setDataSourceFactory(UkelonnDatabaseProvider.java:42)
~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at
no.steria.osgi.jsr330activator.implementation.InjectionMethod.doInject(InjectionMethod.java:55)
~[?:?]
at
no.steria.osgi.jsr330activator.implementation.InjectionBase$1.serviceChanged(InjectionBase.java:33)
~[?:?]
at
org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
~[?:?]
at
org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
~[?:?]
at
org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
~[?:?]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4578)
~[?:?]
at org.apache.felix.framework.Felix.registerService(Felix.java:3570)
~[?:?]
at
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
~[?:?]
at
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:355)
~[?:?]
at org.ops4j.pax.jdbc.impl.Activator.addingBundle(Activator.java:92)
~[?:?]
at org.ops4j.pax.jdbc.impl.Activator.addingBundle(Activator.java:41)
~[?:?]
at
org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)
~[?:?]
at
org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)
~[?:?]
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
~[?:?]
at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
~[?:?]
at org.osgi.util.tracker.BundleTracker.open(BundleTracker.java:156)
~[?:?]
at org.ops4j.pax.jdbc.impl.Activator.start(Activator.java:52) ~[?:?]
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
~[?:?]
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2238)
~[?:?]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144) ~[?:?]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
~[?:?]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1281)
~[?:?]
at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:890)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1170)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$0(FeaturesServiceImpl.java:1069)
~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
The reason for this stack trace is that I receive a DriverDataSourceFactory
OSGi service injection where I'm expecting only a DerbyDataSourceFactory OSGi
service.
In this particular case I have received a DerbyDataSourceFactory
injection first, and it has been setup. Then a DriverDataSourceFactory
injection overwrites the DerbyDataSourceFactory and fails to create the
database.
Are the pax-jdbc and pax-jdbc-derby features in conflict?
Here's the feature repository that is added to karaf:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"
name="ukelonn.karaf">
<feature name="ukelonn-api" description="Ukelonn webapp OSGi service
definitions OSGi bundle" version="1.0.0.SNAPSHOT">
<bundle
start-level="80">mvn:no.priv.bang.ukelonn/ukelonn.api/1.0.0-SNAPSHOT</bundle>
</feature>
<feature name="liquibase-core" start-level="40" version="3.5.3">
<feature prerequisite="true" dependency="false">wrap</feature>
<bundle>mvn:org.yaml/snakeyaml/1.17</bundle>
<bundle>mvn:org.liquibase/liquibase-core/3.5.3</bundle>
<bundle
start-level="35">mvn:no.priv.bang.ukelonn.rebundled/liquibase-slf4j-osgi/2.0.0</bundle>
</feature>
<feature name="ukelonn-db-liquibase" description="Ukelonn webapp Liquibase
change list OSGi bundle" version="1.0.0.SNAPSHOT">
<feature prerequisite="false"
dependency="false">liquibase-core</feature>
<bundle
start-level="80">mvn:no.priv.bang.ukelonn/ukelonn.bundle.db.liquibase/1.0.0-SNAPSHOT</bundle>
</feature>
<feature name="ukelonn-db-derby-test" description="Ukelonn webapp derby
test database OSGi bundle" version="1.0.0.SNAPSHOT">
<feature prerequisite="false" dependency="false">pax-jdbc</feature>
<feature prerequisite="false"
dependency="false">pax-jdbc-derby</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-api</feature>
<feature version="3.5.3" prerequisite="false"
dependency="false">liquibase-core</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-db-liquibase</feature>
<bundle
start-level="80">mvn:no.priv.bang.ukelonn/ukelonn.bundle.db.test/1.0.0-SNAPSHOT</bundle>
</feature>
<feature name="ukelonn-db-postgresql" description="Ukelonn webapp
PostgreSQL database connection OSGi bundle" version="1.0.0.SNAPSHOT">
<feature prerequisite="false"
dependency="false">transaction-api</feature>
<feature prerequisite="false" dependency="false">pax-jdbc</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-api</feature>
<feature version="3.5.3" prerequisite="false"
dependency="false">liquibase-core</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-db-liquibase</feature>
<bundle
start-level="80">mvn:no.priv.bang.ukelonn/ukelonn.bundle.db.postgresql/1.0.0-SNAPSHOT</bundle>
<bundle
start-level="80">mvn:org.postgresql/postgresql/9.4.1211.jre7</bundle>
</feature>
<feature name="ukelonn" description="Ukelonn webapp OSGi bundle"
version="1.0.0.SNAPSHOT">
<feature prerequisite="true" dependency="false">wrap</feature>
<feature prerequisite="false"
dependency="false">pax-http-whiteboard</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-api</feature>
<feature prerequisite="true" dependency="false">wrap</feature>
<bundle
start-level="80">mvn:commons-beanutils/commons-beanutils/1.8.3</bundle>
<bundle
start-level="80">mvn:commons-collections/commons-collections/3.2.2</bundle>
<bundle start-level="80">mvn:org.jsoup/jsoup/1.8.3</bundle>
<bundle start-level="80">mvn:com.vaadin/vaadin-shared/7.6.1</bundle>
<bundle
start-level="80">mvn:com.vaadin.external.flute/flute/1.3.0.gg2</bundle>
<bundle
start-level="80">mvn:com.vaadin.external.streamhtmlparser/streamhtmlparser-jsilver/0.0.10.vaadin1</bundle>
<bundle
start-level="80">mvn:com.vaadin.external.google/guava/16.0.1.vaadin1</bundle>
<bundle
start-level="80">wrap:mvn:com.vaadin.external.gwt/gwt-user/2.7.0.vaadin4</bundle>
<bundle
start-level="80">wrap:mvn:com.vaadin.addon/vaadin-touchkit-agpl/4.1.0</bundle>
<bundle
start-level="80">mvn:no.priv.bang.ukelonn/ukelonn.bundle/1.0.0-SNAPSHOT</bundle>
<bundle start-level="80">mvn:org.apache.shiro/shiro-core/1.3.1</bundle>
<bundle start-level="80">mvn:org.apache.shiro/shiro-web/1.3.1</bundle>
<bundle start-level="80">mvn:com.vaadin/vaadin-server/7.6.1</bundle>
<bundle start-level="80">mvn:com.vaadin/vaadin-themes/7.6.1</bundle>
<bundle
start-level="80">mvn:com.vaadin/vaadin-client-compiled/7.6.1</bundle>
</feature>
<feature name="ukelonn.karaf" description="Ukelonn webapp karaf feature
repository" version="1.0.0.SNAPSHOT">
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-api</feature>
<feature version="3.5.3" prerequisite="false"
dependency="false">liquibase-core</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-db-liquibase</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-db-derby-test</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn-db-postgresql</feature>
<feature version="1.0.0.SNAPSHOT" prerequisite="false"
dependency="false">ukelonn</feature>
</feature>
</features>
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.