Bouncy Castle JCE with Felix

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bouncy Castle JCE with Felix

earcam

Hi,

I've an issue with Bouncy Castle JCE running with Felix (I found this while trying to extend our custom Karaf distro, it seems to be a problem with Karaf 2.2.0 (Felix 3.0.8) through to 2.2.4 (Felix 3.0.9) but doesn't happen when I use Equinox.


Could not create framework: java.lang.ArrayIndexOutOfBoundsException: -1
java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.get(ArrayList.java:324)
    at org.apache.felix.framework.BundleImpl.getCurrentModule(BundleImpl.java:1050)
    at org.apache.felix.framework.BundleImpl.getSymbolicName(BundleImpl.java:859)
    at org.apache.felix.framework.Felix.toString(Felix.java:1019)
    at org.apache.felix.framework.Logger.doLog(Logger.java:128)
    at org.apache.felix.framework.Logger._log(Logger.java:181)
    at org.apache.felix.framework.Logger.log(Logger.java:114)
    at org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:201)
    at org.apache.felix.framework.Felix.<init>(Felix.java:374)
    at org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
    at org.apache.karaf.main.Main.launch(Main.java:266)
    at org.apache.karaf.main.Main.main(Main.java:427)


Steps to reproduce:

wget http://www.apache.org/dyn/closer.cgi/karaf/2.2.4/apache-karaf-2.2.4.tar.gz

tar -xvzf  apache-karaf-2.2.4.tar.gz

cd apache-karaf-2.2.4/

# Assuming you've got bcprov-jdk16-1.46.jar in your maven repo

cp ~/.m2/repository/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar ./lib/ext/

nano etc/custom.properties    # Add the following:

org.osgi.framework.system.packages.extra =  \
   org.bouncycastle.math.ec;version=1.46; \
   org.bouncycastle.jce.provider;version=1.46;
org.apache.felix.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider
org.osgi.framework.bootdelegation = org.bouncycastle.*;

./bin/karaf
# It exits immediately with the stacktrace above


Am I doing something incredibly stupid or should a bug be raised (with Karaf or Felix)?


thanks,
Caspar
Reply | Threaded
Open this post in threaded view
|

Re: Bouncy Castle JCE with Felix

Guillaume Nodet
It definitely looks like a bug in Felix.  Please raise a JIRA for it.

On Thu, Dec 1, 2011 at 17:08, Caspar MacRae <[hidden email]> wrote:

>
> Hi,
>
> I've an issue with Bouncy Castle JCE running with Felix (I found this while
> trying to extend our custom Karaf distro, it seems to be a problem with
> Karaf 2.2.0 (Felix 3.0.8) through to 2.2.4 (Felix 3.0.9) but doesn't happen
> when I use Equinox.
>
>
> Could not create framework: java.lang.ArrayIndexOutOfBoundsException: -1
> java.lang.ArrayIndexOutOfBoundsException: -1
>     at java.util.ArrayList.get(ArrayList.java:324)
>     at
> org.apache.felix.framework.BundleImpl.getCurrentModule(BundleImpl.java:1050)
>     at
> org.apache.felix.framework.BundleImpl.getSymbolicName(BundleImpl.java:859)
>     at org.apache.felix.framework.Felix.toString(Felix.java:1019)
>     at org.apache.felix.framework.Logger.doLog(Logger.java:128)
>     at org.apache.felix.framework.Logger._log(Logger.java:181)
>     at org.apache.felix.framework.Logger.log(Logger.java:114)
>     at
> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:201)
>     at org.apache.felix.framework.Felix.<init>(Felix.java:374)
>     at
> org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
>     at org.apache.karaf.main.Main.launch(Main.java:266)
>     at org.apache.karaf.main.Main.main(Main.java:427)
>
>
> Steps to reproduce:
>
> wget
> http://www.apache.org/dyn/closer.cgi/karaf/2.2.4/apache-karaf-2.2.4.tar.gz
>
> tar -xvzf  apache-karaf-2.2.4.tar.gz
>
> cd apache-karaf-2.2.4/
>
> # Assuming you've got bcprov-jdk16-1.46.jar in your maven repo
>
> cp ~/.m2/repository/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar
> ./lib/ext/
>
> nano etc/custom.properties    # Add the following:
>
> org.osgi.framework.system.packages.extra =  \
>    org.bouncycastle.math.ec;version=1.46; \
>    org.bouncycastle.jce.provider;version=1.46;
> org.apache.felix.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
> org.osgi.framework.bootdelegation = org.bouncycastle.*;
>
> ./bin/karaf
> # It exits immediately with the stacktrace above
>
>
> Am I doing something incredibly stupid or should a bug be raised (with Karaf
> or Felix)?
>
>
> thanks,
> Caspar
>



--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Reply | Threaded
Open this post in threaded view
|

Re: Bouncy Castle JCE with Felix

earcam
Thanks Guillaume,  issue created at https://issues.apache.org/jira/browse/FELIX-3250


On 1 December 2011 16:18, Guillaume Nodet <[hidden email]> wrote:
It definitely looks like a bug in Felix.  Please raise a JIRA for it.

On Thu, Dec 1, 2011 at 17:08, Caspar MacRae <[hidden email]> wrote:
>
> Hi,
>
> I've an issue with Bouncy Castle JCE running with Felix (I found this while
> trying to extend our custom Karaf distro, it seems to be a problem with
> Karaf 2.2.0 (Felix 3.0.8) through to 2.2.4 (Felix 3.0.9) but doesn't happen
> when I use Equinox.
>
>
> Could not create framework: java.lang.ArrayIndexOutOfBoundsException: -1
> java.lang.ArrayIndexOutOfBoundsException: -1
>     at java.util.ArrayList.get(ArrayList.java:324)
>     at
> org.apache.felix.framework.BundleImpl.getCurrentModule(BundleImpl.java:1050)
>     at
> org.apache.felix.framework.BundleImpl.getSymbolicName(BundleImpl.java:859)
>     at org.apache.felix.framework.Felix.toString(Felix.java:1019)
>     at org.apache.felix.framework.Logger.doLog(Logger.java:128)
>     at org.apache.felix.framework.Logger._log(Logger.java:181)
>     at org.apache.felix.framework.Logger.log(Logger.java:114)
>     at
> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:201)
>     at org.apache.felix.framework.Felix.<init>(Felix.java:374)
>     at
> org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
>     at org.apache.karaf.main.Main.launch(Main.java:266)
>     at org.apache.karaf.main.Main.main(Main.java:427)
>
>
> Steps to reproduce:
>
> wget
> http://www.apache.org/dyn/closer.cgi/karaf/2.2.4/apache-karaf-2.2.4.tar.gz
>
> tar -xvzf  apache-karaf-2.2.4.tar.gz
>
> cd apache-karaf-2.2.4/
>
> # Assuming you've got bcprov-jdk16-1.46.jar in your maven repo
>
> cp ~/.m2/repository/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar
> ./lib/ext/
>
> nano etc/custom.properties    # Add the following:
>
> org.osgi.framework.system.packages.extra =  \
>    org.bouncycastle.math.ec;version=1.46; \
>    org.bouncycastle.jce.provider;version=1.46;
> org.apache.felix.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
> org.osgi.framework.bootdelegation = org.bouncycastle.*;
>
> ./bin/karaf
> # It exits immediately with the stacktrace above
>
>
> Am I doing something incredibly stupid or should a bug be raised (with Karaf
> or Felix)?
>
>
> thanks,
> Caspar
>



--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Reply | Threaded
Open this post in threaded view
|

Re: Bouncy Castle JCE with Felix

earcam


Karl Pauls set me straight on that ticket: my mistake, I was using semi-colons instead of commas to delimit the packages



On 1 December 2011 16:30, Caspar MacRae <[hidden email]> wrote:
Thanks Guillaume,  issue created at https://issues.apache.org/jira/browse/FELIX-3250



On 1 December 2011 16:18, Guillaume Nodet <[hidden email]> wrote:
It definitely looks like a bug in Felix.  Please raise a JIRA for it.

On Thu, Dec 1, 2011 at 17:08, Caspar MacRae <[hidden email]> wrote:
>
> Hi,
>
> I've an issue with Bouncy Castle JCE running with Felix (I found this while
> trying to extend our custom Karaf distro, it seems to be a problem with
> Karaf 2.2.0 (Felix 3.0.8) through to 2.2.4 (Felix 3.0.9) but doesn't happen
> when I use Equinox.
>
>
> Could not create framework: java.lang.ArrayIndexOutOfBoundsException: -1
> java.lang.ArrayIndexOutOfBoundsException: -1
>     at java.util.ArrayList.get(ArrayList.java:324)
>     at
> org.apache.felix.framework.BundleImpl.getCurrentModule(BundleImpl.java:1050)
>     at
> org.apache.felix.framework.BundleImpl.getSymbolicName(BundleImpl.java:859)
>     at org.apache.felix.framework.Felix.toString(Felix.java:1019)
>     at org.apache.felix.framework.Logger.doLog(Logger.java:128)
>     at org.apache.felix.framework.Logger._log(Logger.java:181)
>     at org.apache.felix.framework.Logger.log(Logger.java:114)
>     at
> org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:201)
>     at org.apache.felix.framework.Felix.<init>(Felix.java:374)
>     at
> org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
>     at org.apache.karaf.main.Main.launch(Main.java:266)
>     at org.apache.karaf.main.Main.main(Main.java:427)
>
>
> Steps to reproduce:
>
> wget
> http://www.apache.org/dyn/closer.cgi/karaf/2.2.4/apache-karaf-2.2.4.tar.gz
>
> tar -xvzf  apache-karaf-2.2.4.tar.gz
>
> cd apache-karaf-2.2.4/
>
> # Assuming you've got bcprov-jdk16-1.46.jar in your maven repo
>
> cp ~/.m2/repository/org/bouncycastle/bcprov-jdk16/1.46/bcprov-jdk16-1.46.jar
> ./lib/ext/
>
> nano etc/custom.properties    # Add the following:
>
> org.osgi.framework.system.packages.extra =  \
>    org.bouncycastle.math.ec;version=1.46; \
>    org.bouncycastle.jce.provider;version=1.46;
> org.apache.felix.karaf.security.providers =
> org.bouncycastle.jce.provider.BouncyCastleProvider
> org.osgi.framework.bootdelegation = org.bouncycastle.*;
>
> ./bin/karaf
> # It exits immediately with the stacktrace above
>
>
> Am I doing something incredibly stupid or should a bug be raised (with Karaf
> or Felix)?
>
>
> thanks,
> Caspar
>



--
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com