Re: ClassNotFoundException for BouncyCastleProvider

2021-10-22 Thread Jean-Baptiste Onofre
Hi Barry,

Why you don’t install bc as bundle ?

Any requirement to be in lib ?

Regards
JB

> Le 18 oct. 2021 à 16:58, Barry Rawlinson  a écrit 
> :
> 
> Hello,
> 
> Karaf: 4.3.3
> Java: openjdk version "11.0.12" 2021-07-20
> 
> I'm trying to use the BouncyCastleProvider for jasypt PBE (without installing 
> the provider in the JRE).
> 
> Any idea where I am going wrong with this?
> 
> I have followed the instructions here: 
> https://karaf.apache.org/manual/latest/#_security_providers
> 
> Downloaded the bouncy castle jar to:
> 
> ${KARAF_HOME}/lib/ext/bcprov-jdk15on-1.69.jar
> 
> Added this to the end of config.properties:
> 
> org.apache.karaf.security.providers=org.bouncycastle.jce.provider.BouncyCastleProvider
> 
> Edited config.properties (I've also tried org.bouncycastle.*, \):
> 
> org.osgi.framework.bootdelegation = \
> com.sun.*, \
> org.bouncycastle*, \
> 
> But whenever I start karaf with the blueprint below deployed I always get:
> 
> BlueprintContainerImpl   | 57 - org.apache.aries.blueprint.core - 
> 1.10.3 | Unable to start container for blueprint bundle 
> bouncycastle-bp.xml/0.0.0
> org.osgi.service.blueprint.container.ComponentDefinitionException: Error 
> setting property: PropertyDescriptor  setter: [class 
> org.jasypt.encryption.pbe.config.EnvironmentPBEConfig.setProviderClassName(class
>  java.lang.String)]
> 
> Caused by: org.jasypt.exceptions.EncryptionInitializationException: 
> java.lang.ClassNotFoundException: 
> org.bouncycastle.jce.provider.BouncyCastleProvider
> 
> Caused by: java.lang.ClassNotFoundException: 
> org.bouncycastle.jce.provider.BouncyCastleProvider
> 
> 
> http://www.osgi.org/xmlns/blueprint/v1.0.0;
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0;
>xsi:schemaLocation="
>  http://www.osgi.org/xmlns/blueprint/v1.0.0 
> https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
>  http://camel.apache.org/schema/blueprint 
> http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
>  http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 
> http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd;>
> 
>  class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
>  value="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
> 
> 
> 
>  xmlns="http://camel.apache.org/schema/blueprint;>
> 
> 
> 
> 
> 
> --
> TIA.  
> Barry.



Re: Feature install of pax-jdbc-oracle fails

2021-10-22 Thread Jean-Baptiste Onofre
HI Oliver,

I will check for next PAX JDBC (maybe SMX bundle) release.

I will keep you posted.

Regards
JB

> Le 15 oct. 2021 à 08:38, Oliver Fürniß  a écrit :
> 
> Hi JB,
> 
> > Let me provide a wrapping to you as workaround.
> Would be great if you would provide a workaround. :-)
> 
> Oliver
> 
> Am Do., 7. Okt. 2021 um 11:01 Uhr schrieb Jean-Baptiste Onofré 
> :
> Hi Oliver,
> 
> I think that the Oracle driver headers are not fully correct.
> 
> Let me provide a wrapping to you as workaround.
> 
> Regards
> JB
> 
> On 07/10/2021 10:52, Oliver Fürniß wrote:
> > 
> > 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 
> > mailto:jtt77...@gmail.com>>:
> > 
> > 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ß
> > mailto:oliver.fuern...@virtimo.de>> 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.
> > 
> > 
> > 
> >  This feature requires actual Oracle JDBC driver 
> > installed
> >  pax-jdbc-spec
> > 
> >   > dependency="true">wrap:mvn:com.oracle.database.jdbc/ojdbc8/${version.com.oracle.database.jdbc}
> >  
> > mvn:org.ops4j.pax.jdbc/pax-jdbc-oracle/${project.version}
> > 
> > 
> > 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
> > 
> >