问题
I am trying to configure bouncycastle in IBM Websphere App Server 7, my JRE Version is 1.6. I am getting the following error when trying to run the code:
Caused by: java.lang.ClassNotFoundException: sun.security.provider.Sun
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:111)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:543)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
... 47 more
I have tried the following:
- Placing bcprov-jdk15-145 in jre/lib/ext
- Placing bouncycastle-1.20 in project lib.
- Adding the following entry at the end in java.security file - security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider
- Placed Sun JSSE jars in server's Runtime Folder
回答1:
Refer to example provided in http://www.jasypt.org/non-default-providers.html. Somewhere you have to code to choose the provider as BouncyCastleProvider in your code. Currently by default it is not picking that.
回答2:
Third party JCE Providers (including Sun JCE) are not supported in IBM WebSphere Application Server.
Get ready for weird issues in your server if you continue using them...
来源:https://stackoverflow.com/questions/44105570/bouncy-castle-integration-in-websphere-causing-the-following-error