Friday, 21 November 2014

JBoss : ClassNotFoundException org.bouncycastle.jce.provider.BouncyCastleProvider


1. WHAT happened 

I downloaded jboss EAP 6.3.0.GA (AS 7.4.0.Final)  and when launching the server in standalone mode with jdk 1.7.0_25, below error is shown in the console :



 [The provider BC could not be added: org.bouncycastle.jce.provider.BouncyCastleProvider from [Module "org.apache.ws.security:main" from local module loader ......
java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider from [Module "org.apache.ws.security:main" from local module loader ......


2. WHY it happened

It seems the jboss web service security module is using Bouncy Castle (BC) as Java Security Provider and it is not loaded in the class path.


3. HOW to resolve it

Obviously we have to add BC binaries to runtime classpath :

Step 1 : download BC jar files and copy to $JAVA_HOME/jre/lib/ext .

Step 2 : in order for BC to work with java properly we have to install Java Cryptography Extension , installation instruction is inside the distribution zip

Step 3 : update $JAVA_HOME/jre/lib/security/java.security configuration file to add BC as a security provider with below :
security.provider.N=org.bouncycastle.jce.provider.BouncyCastleProvider

Step 4 : restart jboss the error should be gone already


4. reference




2 comments:

  1. Thanks for the info. Do you have a link to where the JCE zip file can be downloaded from?

    ReplyDelete
    Replies
    1. for java 8 : http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
      download links could be found here : http://www.oracle.com/technetwork/java/javase/downloads/index.html

      Delete

Flag Counter