Hi John,

Thanks for your response. I tried your suggestion, but it does not work due
to a wiring error when I try to install the bundle:

bundle:install -s mvn:org.ops4j.pax.jdbc/pax-jdbc-oracle/1.5.0
Bundle ID: 266
Error executing command: Error installing bundles:
Unable to start bundle mvn:org.ops4j.pax.jdbc/pax-jdbc-oracle/1.5.0:
org.osgi.framework.BundleException: Unable to resolve
org.ops4j.pax.jdbc.oracle [266](R 266.0): missing requirement
[org.ops4j.pax.jdbc.oracle [266](R 266.0)] osgi.wiring.package;
(osgi.wiring.package=oracle.jdbc.datasource.impl) Unresolved requirements:
[[org.ops4j.pax.jdbc.oracle [266](R 266.0)] osgi.wiring.package;
(osgi.wiring.package=oracle.jdbc.datasource.impl)]

In the pax-jdbc-oracle-1.5.0.jar/META-INF/MANIFEST.MF is an Import-Package
statement for the "oracle.jdbc.datasource.impl" package, but this package
does not exist in older Oracle JDBC drivers. Just in the latest. :-(

Oliver

Am Mi., 6. Okt. 2021 um 17:24 Uhr schrieb John Taylor <[email protected]>:

> Hi Oliver,
> I had the same problem with mssql-jdbc.
> But it's not exactly the same because the pax-jdbc-mssql feature only
> depends on pax-jdbc-spec and only includes the driver mvn:com.microsoft. .
> .    And that means there's no wrapper around the driver needed for osgi
> and nothing is needed specially to configure it from pax.
>
> But the pax-jdb-oracle feature includes the driver from oracle (wrapped as
> wrap:mvn: because it's not an osgi bundle) and a wrapper from pax
> mvn:org.ops4j.pax.jdbc/pax-jdbc-oracle/1.5.0
>
> So you could try not installing the bundle and just install the
> pax-jdbc-spec and the mvn:org.ops4j.pax.jdbc bundle along with the driver
> jar you put in deploy.
>
> -John
>
> On Wed, Oct 6, 2021 at 11:13 AM Oliver Fürniß <[email protected]>
> wrote:
>
>> Hello,
>>
>> I'm trying to upgrade from Karaf 4.2.8 to 4.3.3.
>>
>> With 4.2.8 I was able to place the required Oracle driver to the
>> deploy-folder and do a "feature:install pax-jdbc-oracle". With 4.3.3 it
>> seems to be a little bit different. When I place the ojdbc6.jar or
>> ojdbc7.jar or ojdbc8.jar in the deploy folder I will get the error below
>> (at the end) after "feature:install pax-jdbc-oracle".
>>
>> It works when I do not place a specific Oracle driver to the deploy
>> folder and just do "feature:install pax-jdbc-oracle". In this case it
>> installs the latest Oracle driver by using maven.
>>
>> This is different to 4.2.8 and not the expected behaviour. IMO the latest
>> Oracle driver cannot be used for all Oracle versions. Even Oracle provides
>> specific downloads of their JDBC driver for different DB versions:
>> https://www.oracle.com/de/database/technologies/appdev/jdbc-downloads.html
>>
>> In the ops4j features.xml file details is written, that "This feature
>> requires actual Oracle JDBC driver installed", which conflicts with the
>> auto bundle dependency installation of the latest Oracle driver. This line
>> does not exist in 4.2.8.
>>
>> <feature name="pax-jdbc-oracle" description="Provides JDBC Oracle
>> DataSourceFactory" version="${project.version}">
>>
>>     <details>This feature requires actual Oracle JDBC driver 
>> installed</details>
>>     <feature>pax-jdbc-spec</feature>
>>
>>     <bundle 
>> dependency="true">wrap:mvn:com.oracle.database.jdbc/ojdbc8/${version.com.oracle.database.jdbc}</bundle>
>>     
>> <bundle>mvn:org.ops4j.pax.jdbc/pax-jdbc-oracle/${project.version}</bundle>
>> </feature>
>>
>> Is there a reason why the latest and not with all Oracle versions
>> compatible driver gets installed? Am I able to install somehow a different
>> version of the Oracle driver?
>>
>> All the best,
>>  Oliver
>>
>>
>> karaf@root()> feature:install pax-jdbc-oracle
>> org.apache.karaf.features.internal.util.MultiException: Error restarting
>> bundles:
>> Activator start error in bundle org.ops4j.pax.jdbc.oracle [223].
>> at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1049)
>> at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>> at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>> at
>> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>> at
>> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>> at java.base/java.lang.Thread.run(Thread.java:829)
>> Suppressed: org.osgi.framework.BundleException: Activator start error in
>> bundle org.ops4j.pax.jdbc.oracle [223].
>> at org.apache.felix.framework.Felix.activateBundle(Felix.java:2452)
>> at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
>> 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.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165)
>> at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1160)
>> at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1041)
>> ... 6 more
>> Caused by: java.lang.NoClassDefFoundError: oracle/jdbc/internal/Monitor
>> at java.base/java.lang.ClassLoader.defineClass1(Native Method)
>> at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2312)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2130)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2064)
>> at
>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1533)
>> at
>> org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
>> at
>> org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1343)
>> at
>> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1586)
>> at
>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1516)
>> at
>> org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
>> at org.ops4j.pax.jdbc.oracle.impl.Activator.start(Activator.java:29)
>> at
>> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:698)
>> at org.apache.felix.framework.Felix.activateBundle(Felix.java:2402)
>> ... 12 more
>> Caused by: java.lang.ClassNotFoundException: oracle.jdbc.internal.Monitor
>> not found by ojdbc7.jar [222]
>> at
>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1565)
>> at
>> org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
>> at
>> org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1343)
>> at
>> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1586)
>> at
>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1516)
>> at
>> org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
>> at
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
>> ... 30 more
>> Error executing command: Error restarting bundles:
>> Activator start error in bundle org.ops4j.pax.jdbc.oracle [223].
>>
>>

Reply via email to