我正在尝试在我全新的 MacBook Pro 上设置 Tomcat 应用程序开发环境。我需要设置一个实现org.bouncycastle.jce.provider.BouncyCastleProvider的 SSL 连接器。
Tomcat 7 启动,但 SSL 连接器无法安装,我在 Tomcat Out 中读取了此堆栈:
Grave: Failed to initialize connector [Connector[HTTP/1.1-9443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-9443]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: L''initialisation du gestionnaire de protocole a échoué
at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Caused by: java.lang.ClassNotFoundException: Error loading SSL Implementation org.bouncycastle.jce.provider.BouncyCastleProvider :java.lang.ClassCastException: org.bouncycastle.jce.provider.BouncyCastleProvider cannot be cast to org.apache.tomcat.util.net.SSLImplementation
at org.apache.tomcat.util.net.SSLImplementation.getInstance(SSLImplementation.java:75)
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:118)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
... 13 more
有些东西告诉我它与“java.lang.ClassNotFoundException:”有关。org.bouncycastle.jce.provider.BouncyCastleProvider
但是我在 JAVA_HOME/lib/ext 中找到了包含类的 jar 。我什至尝试将它放在 CATALINA_BASE/lib 中,以查看这是否来自 ClassPath 错误。没有 !
Tomcat server.xml 摘录:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/Users/xavier/ssl/pchain.keystore"
keystorePass="pwd" />
<Connector port="9443" keystorePass="pwd" alias="pca"
keystoreFile="/Users/xavier/ssl/pca.keystore" keystoreType="BKS"
SSLEnabled="true" clientAuth="false" protocol="HTTP/1.1" scheme="https"
secure="true" sslProtocol="TLS" sslImplementationName="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
这是我的配置信息:
OS X 版本 10.8.3、JDK 1.7.0_45、Tomcat 版本 7.0.42。BouncyCastle 测试包:bcprov-jdk15on-146.jar 到 bcprov-jdk15on-149.jar
有人已经解决了这个问题吗?