Hi,

I want to use BouncyCastle v 1.45 with Identity Server. In my pom.xml for
the service component I have used the following configuration to import the
BouncyCastle classes,

<Import-Package>org.apache.axis2.*,
                            org.wso2.carbon.core.utils.*,
                            org.wso2.carbon.core.*,
                            org.wso2.carbon.registry.core.*,
                            org.wso2.carbon.utils.*,
                            org.apache.commons.logging.*; version="1.0.4",
                            org.osgi.framework,
                            javax.servlet,
                            javax.servlet.http,
                            org.bouncycastle.*; version="1.45.0.wso2v1",
                            org.wso2.carbon.security.*,
                            *;resolution:=optional
</Import-Package>

also, I have added the dependency as,

        <dependency>
            <groupId>org.bouncycastle.wso2</groupId>
            <artifactId>bcprov-jdk16</artifactId>
            <version>1.45.wso2v1</version>
        </dependency>

This compiles without any errors. But, with this configuration, I get a
"java.lang.NoSuchFieldError" at runtime. When I debugged using the OSGI
console, I noticed that my service component Imports a previous version
(1.32) of bouncycastle from wss4j, although I have requested it to import
"1.45". And the field I'm using was not available in ver. 1.32.

Following is the partial output of "osgi>b 229", where 229 is the bundle id
of my service component.

  Imported packages
    .....
    org.bouncycastle.asn1; version="132.0.0"<wss4j_1.5.11.wso2v6 [418]>
    org.bouncycastle.asn1.pkcs; version="132.0.0"<wss4j_1.5.11.wso2v6 [418]>
    org.bouncycastle.asn1.x509; version="132.0.0"<wss4j_1.5.11.wso2v6 [418]>
    org.bouncycastle.jce; version="132.0.0"<wss4j_1.5.11.wso2v6 [418]>
    org.bouncycastle.jce.provider; version="132.0.0"<wss4j_1.5.11.wso2v6
[418]>


Bouncycastle 1.45 is not included in IS. Therefore I copied it to the
dropins folder, and confirmed that it is loaded from osgi console. Still It
has chosen to load bouncycastle classes from wss4j.

osgi>ss
....
22 ACTIVE      bcprov-jdk16_1.45.0.wso2v1
......


osgi>b 22
....
Exported packages
    org.bouncycastle; version="1.45.0.wso2v1"[exported]
    org.bouncycastle.asn1; version="1.45.0.wso2v1"[exported]
    org.bouncycastle.asn1.bc; version="1.45.0.wso2v1"[exported]
....


How can I fix this issue to load the correct version?

-- 
*Pulasthi Mahawithana*
Software Engineer
WSO2 Inc., http://wso2.com/
Mobile: +94-71-5179022
Blog: http://blog.pulasthi.org
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to