Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CentOS 6 JBoss:“;javax.net.ssl.SSLHandshakeException:找不到请求目标的有效证书路径;_Java_Centos6_Sslhandshakeexception_Sslerrorhandler - Fatal编程技术网

CentOS 6 JBoss:“;javax.net.ssl.SSLHandshakeException:找不到请求目标的有效证书路径;

CentOS 6 JBoss:“;javax.net.ssl.SSLHandshakeException:找不到请求目标的有效证书路径;,java,centos6,sslhandshakeexception,sslerrorhandler,Java,Centos6,Sslhandshakeexception,Sslerrorhandler,我有一个JBoss应用程序[Java(TM)SE运行时环境(build 1.7.0-b147)],运行在CentOS 6服务器上,该服务器将信息发送到外部地址,偶尔会出现如下所述的错误 2019-11-25 09:37:04,919 INFO [STDOUT] ERRO: boletoComercioEletronicoBB - Boleto: 30293750000040348 2019-11-25 09:37:04,920 ERROR [STDERR] **javax.net.ssl.SS

我有一个JBoss应用程序[Java(TM)SE运行时环境(build 1.7.0-b147)],运行在CentOS 6服务器上,该服务器将信息发送到外部地址,偶尔会出现如下所述的错误

2019-11-25 09:37:04,919 INFO  [STDOUT] ERRO: boletoComercioEletronicoBB - Boleto: 30293750000040348
2019-11-25 09:37:04,920 ERROR [STDERR] **javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target**
2019-11-25 09:37:04,922 ERROR [STDERR] at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
2019-11-25 09:37:04,922 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1836)
2019-11-25 09:37:04,922 ERROR [STDERR] at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
2019-11-25 09:37:04,923 ERROR [STDERR] at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
2019-11-25 09:37:04,923 ERROR [STDERR] at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1337)
2019-11-25 09:37:04,923 ERROR [STDERR] at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:154)
2019-11-25 09:37:04,923 ERROR [STDERR] at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
2019-11-25 09:37:04,923 ERROR [STDERR] at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
2019-11-25 09:37:04,923 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:966)
2019-11-25 09:37:04,923 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1262)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1289)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1273)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:523)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1087)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
2019-11-25 09:37:04,924 ERROR [STDERR] at creacorp.financeiro.facade.BoletoFacadeBean.boletoComercioEletronicoBB(BoletoFacadeBean.java:4398)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor975.invoke(Unknown Source)
2019-11-25 09:37:04,924 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2019-11-25 09:37:04,925 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:601)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,925 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,926 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
2019-11-25 09:37:04,927 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
2019-11-25 09:37:04,927 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
2019-11-25 09:37:04,927 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
2019-11-25 09:37:04,927 ERROR [STDERR] at $Proxy3127.boletoComercioEletronicoBB(Unknown Source)
2019-11-25 09:37:04,927 ERROR [STDERR] at creacorp.cadastro.struts.action.profissional.LeituraArquivoXMLParaConfea.lerArquivosXmlAtualizandoDados(LeituraArquivoXMLParaConfea.java:883)
2019-11-25 09:37:04,927 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2019-11-25 09:37:04,927 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
2019-11-25 09:37:04,927 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2019-11-25 09:37:04,927 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:601)
2019-11-25 09:37:04,927 ERROR [STDERR] at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
2019-11-25 09:37:04,927 ERROR [STDERR] at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
2019-11-25 09:37:04,927 ERROR [STDERR] at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:53)
2019-11-25 09:37:04,927 ERROR [STDERR] at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:64)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:446)
2019-11-25 09:37:04,928 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
2019-11-25 09:37:04,928 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
2019-11-25 09:37:04,928 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2019-11-25 09:37:04,928 ERROR [STDERR] at creacorp.cadastro.security.AutorizacaoFilter.doFilter(AutorizacaoFilter.java:134)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
2019-11-25 09:37:04,929 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
2019-11-25 09:37:04,930 ERROR [STDERR] at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
2019-11-25 09:37:04,930 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
2019-11-25 09:37:04,930 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
2019-11-25 09:37:04,930 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
2019-11-25 09:37:04,930 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
2019-11-25 09:37:04,930 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
2019-11-25 09:37:04,930 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
2019-11-25 09:37:04,930 ERROR [STDERR] at java.lang.Thread.run(Thread.java:722)
2019-11-25 09:37:04,933 ERROR [STDERR] Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2019-11-25 09:37:04,933 ERROR [STDERR] at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
2019-11-25 09:37:04,933 ERROR [STDERR] at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
2019-11-25 09:37:04,933 ERROR [STDERR] at sun.security.validator.Validator.validate(Validator.java:260)
2019-11-25 09:37:04,933 ERROR [STDERR] at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)
2019-11-25 09:37:04,933 ERROR [STDERR] at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)
2019-11-25 09:37:04,933 ERROR [STDERR] at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
2019-11-25 09:37:04,933 ERROR [STDERR] at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1319)

我在其他CentOS 6和7服务器上使用Java版本1.8.0_201测试了该应用程序,该错误仅出现在版本1.7的服务器上。是吗?

不清楚你所说的“是吗?”。但是错误(即PKIX路径生成失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径)看起来很常见。这通常表示您的信任存储需要更新为您尝试连接的服务器的服务器证书签名的ca的ca证书。是否有证书的默认路径?在CentOS中,jboss安装在/usr/local/jboss-4.0.5.GA上,在/bin或类似文件中没有类似“security\cacerts”的路径。目前,我在另一个vm上测试了Java升级,并在不配置证书的情况下解决了问题。但无论如何,我仍然想了解如何配置证书,以便将来不会发生事件。“certificatepath”不是指指向证书的目录路径,而是指从服务器证书链上到服务器证书的CA证书的路径(服务器证书->中间ca证书->根ca证书)。因此,需要使用最新的CA和中间证书更新cacert,以获得您正在访问的服务器的服务器证书。我猜,通过升级Java版本,您可能升级了cacert,这就是它工作的原因。另一种修复方法是只更新cacert。