четверг, 1 марта 2018 г.

Ошибка "sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" и вариант её решения

Ошибка:
После включения HTTPS (и отключения HTTP) может возникнуть следующая ошибка:
 <oracle.soa.bpel.engine.ws> <BEA-000000> <got FabricInvocationException  
 sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  
     at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196)  
     at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)  
     at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)  
     at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)  
     at sun.security.validator.Validator.validate(Validator.java:260)  
     at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326)  
     at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231)  
     at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)  
     at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1454)  
     at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:213)  
     at sun.security.ssl.Handshaker.processLoop(Handshaker.java:913)  
     at sun.security.ssl.Handshaker.process_record(Handshaker.java:849)  
     at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1035)  
     at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)  
     at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:721)  
     at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)  
     at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:167)  
     at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3398)  
     at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:3310)  
     at HTTPClient.HTTPConnection$10.run(HTTPConnection.java:3061)  
     at HTTPClient.HTTPConnection$10.run(HTTPConnection.java:3052)  
     at HTTPClient.HttpClientConfiguration.doAction(HttpClientConfiguration.java:708)  
     at HTTPClient.HTTPConnection.doAction(HTTPConnection.java:5497)  
     at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:3052)  
     at HTTPClient.HTTPConnection.Get(HTTPConnection.java:927)  
     at HTTPClient.HTTPConnection.Get(HTTPConnection.java:831)  
     at oracle.j2ee.ws.wsdl.xml.WSDLReaderImpl.openAsStreamConnection(WSDLReaderImpl.java:548)  
     at oracle.j2ee.ws.wsdl.xml.WSDLReaderImpl.readDocument(WSDLReaderImpl.java:438)  
     at oracle.j2ee.ws.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:377)  
     at oracle.j2ee.ws.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:627)  
     at oracle.j2ee.ws.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:605)  
     at oracle.j2ee.ws.common.jaxws.WSDLMetadata.readWsdlDefinition(WSDLMetadata.java:377)  
     at oracle.j2ee.ws.common.jaxws.WSDLMetadata.initPortsFromWsdl(WSDLMetadata.java:202)  
     at oracle.j2ee.ws.common.jaxws.WSDLMetadata.initPorts(WSDLMetadata.java:171)  
     at oracle.j2ee.ws.common.jaxws.WSDLMetadata.getPort(WSDLMetadata.java:444)  
     at oracle.j2ee.ws.common.jaxws.ServiceDelegateImpl.createDispatch(ServiceDelegateImpl.java:275)  
     at javax.xml.ws.Service.createDispatch(Service.java:352)  
     at oracle.integration.platform.blocks.soap.AbstractWebServiceBindingComponent.dispatchRequest(AbstractWebServiceBindingComponent.java:558)  
     at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.processOutboundMessage(WebServiceExternalBindingComponent.java:314)  
     at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.sendSOAPMessage(WebServiceExternalBindingComponent.java:1230)  
     at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.request(WebServiceExternalBindingComponent.java:815)  
     at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:139)  
     at oracle.integration.platform.blocks.mesh.MessageRouter.request(MessageRouter.java:182)  
     at oracle.integration.platform.blocks.mesh.MeshImpl.request(MeshImpl.java:190)  
     at sun.reflect.GeneratedMethodAccessor1787.invoke(Unknown Source)  
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
     at java.lang.reflect.Method.invoke(Method.java:606)  
     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)  
     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)  
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)  
     at oracle.integration.platform.metrics.PhaseEventAspect.invoke(PhaseEventAspect.java:71)  
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)  
     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)  
     at com.sun.proxy.$Proxy390.request(Unknown Source)  
     at oracle.fabric.CubeServiceEngine.requestToMesh(CubeServiceEngine.java:859)  
     at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:279)  
     at com.collaxa.cube.engine.ext.common.InvokeHandler.__invoke(InvokeHandler.java:1131)  
     at com.collaxa.cube.engine.ext.common.InvokeHandler.handleNormalInvoke(InvokeHandler.java:626)  
     at com.collaxa.cube.engine.ext.common.InvokeHandler.handle(InvokeHandler.java:131)  
     at com.collaxa.cube.engine.ext.bpel.common.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:74)  
     at com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform(BaseBPELActivityWMP.java:173)  
     at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:2721)  
     at com.collaxa.cube.engine.CubeEngine._handleWorkItem(CubeEngine.java:1197)  
     at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1100)  
     at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:76)  
     at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:251)  
     at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:330)  
     at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4653)  
     at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4584)  
     at com.collaxa.cube.engine.CubeEngine._createAndInvoke(CubeEngine.java:714)  
     at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:559)  
     at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:535)  
     at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:319)  
     at sun.reflect.GeneratedMethodAccessor2242.invoke(Unknown Source)  
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
     at java.lang.reflect.Method.invoke(Method.java:606)  
     at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)  
     at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)  
     at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)  
     at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:103)  
     at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:113)  
     at java.security.AccessController.doPrivileged(Native Method)  
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)  
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)  
     at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:100)  
     at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:154)  
     at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:113)  
     at sun.reflect.GeneratedMethodAccessor1196.invoke(Unknown Source)  
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
     at java.lang.reflect.Method.invoke(Method.java:606)  
     at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)  
     at com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:68)  
     at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)  
     at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)  
     at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)  
     at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)  
     at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)  
     at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)  
     at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)  
     at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)  
     at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)  
     at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)  
     at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)  
     at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)  
     at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)  
     at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)  
     at com.sun.proxy.$Proxy371.handleInvoke(Unknown Source)  
     at com.collaxa.cube.engine.ejb.impl.bpel.BPELDeliveryBean_5k948i_ICubeDeliveryLocalBeanImpl.__WL_invoke(Unknown Source)  
     at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39)  
     at com.collaxa.cube.engine.ejb.impl.bpel.BPELDeliveryBean_5k948i_ICubeDeliveryLocalBeanImpl.handleInvoke(Unknown Source)  
     at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:30)  
     at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:141)  
     at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatchTask.java:89)  
     at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:65)  
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
     at com.collaxa.cube.engine.dispatch.Dispatcher$ContextCapturingThreadFactory$2.run(Dispatcher.java:933)  
     at java.lang.Thread.run(Thread.java:745)  
 >  

Причина:
Не до конца завершена конфигурация HTTPS (TLS).

Вариант решения:
Необходимо добавить в параметры старта Weblogic-серверов следующие свойства:
 -Djavax.net.ssl.trustStoreType=JKS  
 -Djavax.net.ssl.trustStorePassword=XXXXX