7 Replies Latest reply on Aug 8, 2013 8:46 AM by Stephen Coy

    java.security.NoSuchAlgorithmException after deploying application on JBoss AS 7

    Sunil M L Newbie

      Hello,

       

      I am trying to deploy my application on JBoss AS 7. Before I had my application successfully running on JBoss 4

       

      Now I am facing a problem in encryption after deploying my application on JBoss AS 7.

       

      My code uses javax.crypto.SecretKeyFactory which can be found in jce.jar. I have created a new module in JBoss and placed this jar along with other required jars[like sunjce_provider.jar, local_policy.jar]. Also I declared this module as dependencies in MANIFEST.MF of my ear.

       

      ear is deployed without any errors. But when I actually access login page of my application it is throwing the following execption when it actually tries to encrypt the password entered in login page.

           java.security.NoSuchAlgorithmException: PBEwithMD5andDES SecretKeyFactory not available

                at javax.crypto.SecretKeyFactory.<init>(DashoA13*..)   

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

       

       

      The exact line in my code where this exception was thrown is

       

      SecretKeyFactory factory = SecretKeyFactory.getInstance("PBEwithMD5andDES");

       

      The same application is running well in JBoss 4.

       

      I think I am mising some dependency configuration required to run this code segment. But I am not able to figure it out from last 2 days. I checked few blogs related to similar error. But nothing helped me so far.

       

      Please help me in resolving this error. Let me know if more details are required.

       

       

      Thanks,

      Sunil