1 Reply Latest reply on Dec 21, 2011 9:39 AM by iabughosh

    Encryption fails with JBoss 6

    iabughosh Master


      I've Encryption Utility for my project, it works fine on Tomcat 6, but when i use it with JBoss 6 Final it throws this exception :

      Exception in thread "main" java.lang.SecurityException: JCE cannot authenticate the provider SunJCE

                at javax.crypto.Cipher.getInstance(DashoA13*..)

                at com.blackbelt.common.util.EncryptionUtil.encrypt(EncryptionUtil.java:43)

                at com.bbtech.docx.engine.DocXchangeEngine.main(DocXchangeEngine.java:1288)

      Caused by: java.util.jar.JarException: Class is on the bootclasspath

                at javax.crypto.SunJCE_c.a(DashoA13*..)

                at javax.crypto.SunJCE_b.b(DashoA13*..)

                at javax.crypto.SunJCE_b.a(DashoA13*..)

                ... 3 more


      my env:

      JDK 1.6.0_24,

      Windows 7,

      JBoss 6


      similar issue in JIRA : https://issues.jboss.org/browse/JBAS-7882



        • 1. Re: Encryption fails with JBoss 6
          iabughosh Master

          I solved this, with eclipse i have modified the JDK path, where jre path is diffrent ex:

          JDK path : ...program files (x86)/java/jdk1.6.0_24

          JRE path : ...program files/java/jre


          so sunjce_provider.jar in JRE is considered restricted for JDK.

          thanks for windows 7 for installing java in more than one path, i didn't have this issue on CentOS env.