迁移:: Jboss 6.0 eap toWildfly 10.01 + Java 8- java.security.NoSuchProviderException:JCE无法验证提供者BC

时间:2017-07-04 18:03:57

标签: java-8 wildfly-10

当我在wildfly 10上部署耳朵时,我遇到了以下错误。

我使用过最新的jar(bcprov-jdk16-1.46.jar和bcmail-jdk16-1.46.jar),但没有用。

13:46:35,654 ERROR [stderr] (ServerService Thread Pool -- 76) java.security.NoSuchProviderException: JCE cannot authenticate the provider BC
13:46:35,654 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.JceSecurity.getInstance(JceSecurity.java:100)
13:46:35,669 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:204)
13:46:35,669 ERROR [stderr] (ServerService Thread Pool -- 76)   at com.generic.util.EncryptionUtils.getKey(EncryptionUtils.java:165)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at com.generic.util.EncryptionUtils.initializeDecryptionCipher(EncryptionUtils.java:230)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at com.generic.util.EncryptionUtils.isEncrypted(EncryptionUtils.java:93)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at com.generic.system.SystemStartup.loadDefaulBSettings(SystemStartup.java:286)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at com.generic.system.SystemStartup.startUp(SystemStartup.java:120)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at sample.servlets.tartup.init(Startup.java:187)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
13:46:35,685 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
13:46:35,700 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:250)
13:46:35,700 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:133)
13:46:35,700 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:546)
13:46:35,700 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:517)
13:46:35,700 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
13:46:35,700 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
13:46:35,716 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
13:46:35,716 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
13:46:35,716 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
13:46:35,716 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
13:46:35,716 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:559)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at java.lang.Thread.run(Thread.java:748)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76)   at org.jboss.threads.JBossThread.run(JBossThread.java:320)
13:46:35,732 ERROR [stderr] (ServerService Thread Pool -- 76) Caused by: java.lang.SecurityException: Cannot verify jar:vfs:/E:/myprj/wildfly-10.1.0.Final/bin/content/myapp.ear/lib/tik
a-app-1.4.jar!/
13:46:35,747 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:446)
13:46:35,747 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:361)
13:46:35,747 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.JarVerifier.verify(JarVerifier.java:289)
13:46:35,747 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:159)
13:46:35,747 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:185)
13:46:35,747 ERROR [stderr] (ServerService Thread Pool -- 76)   at javax.crypto.JceSecurity.getInstance(JceSecurity.java:97)

1 个答案:

答案 0 :(得分:0)

有两种解决方法。

  1. 使用libs(bcprov-jdk16-1.46.jar,bcmail-jdk16-1.46.jar)创建模块并将其导入jboss-deployment-structure.xml
  2. 您可以使用选项use-physical-code-source =&#34; true&#34;将jboss-deployment-structure.xml中的jar作为资源添加。例: <resource-root path="/lib/bcprov-jdk16-1.46.jar" use-physical-code-source="true"/>