【问题标题】:Bouncy-castle integration in Websphere causing the following errorWebsphere 中的 Bouncy-castle 集成导致以下错误
【发布时间】:2017-10-21 16:20:15
【问题描述】:

我正在尝试在 IBM Websphere App Server 7 中配置 bouncycastle,我的 JRE 版本是 1.6。尝试运行代码时出现以下错误:

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

我尝试了以下方法:

  1. 将 bcprov-jdk15-145 放在 jre/lib/ext 中
  2. 将 bouncycastle-1.20 放入项目库中。
  3. 在 java.security 文件的末尾添加以下条目 - security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider
  4. 将 Sun JSSE jar 放在服务器的运行时文件夹中

【问题讨论】:

    标签: java websphere payment-gateway bouncycastle


    【解决方案1】:

    第三方 JCE 提供者(包括 Sun JCE) 在 IBM WebSphere Application Server 中是 not supported

    如果您继续使用它们,请为您的服务器中的奇怪问题做好准备......

    【讨论】:

      【解决方案2】:

      请参阅http://www.jasypt.org/non-default-providers.html 中提供的示例。您必须在某处编码以在您的代码中选择提供者作为 BouncyCastleProvider。目前默认情况下它不会选择那个。

      【讨论】:

        猜你喜欢
        • 2020-10-27
        • 1970-01-01
        • 1970-01-01
        • 2017-02-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-09-18
        • 1970-01-01
        相关资源
        最近更新 更多