Certificate Exception In calling generated stub of AndesAdminService WSDL in wso2 message broker -
i using on wso2 message broker message brokering system in project. queue information (information queues created in wso2mb server, number of messages in each queue , on), generated client andesadminservics wsdl , tried call getallqueues() api api. everytime getting unable find valid certification path requested target exception. not able figure out problem. exception -
jul 06, 2016 5:21:19 pm org.apache.axis.utils.javautils isattachmentsupported warning: unable find required classes (javax.activation.datahandler , javax.mail.internet.mimemultipart). attachment support disabled. axisfault faultcode: {http://schemas.xmlsoap.org/soap/envelope/}server.userexception faultsubcode: faultstring: javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target faultactor: faultnode: faultdetail: {http://xml.apache.org/axis/}stacktrace:javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.ssl.alerts.getsslexception(unknown source) @ sun.security.ssl.sslsocketimpl.fatal(unknown source) @ sun.security.ssl.handshaker.fatalse(unknown source) @ sun.security.ssl.handshaker.fatalse(unknown source) @ sun.security.ssl.clienthandshaker.servercertificate(unknown source) @ sun.security.ssl.clienthandshaker.processmessage(unknown source) @ sun.security.ssl.handshaker.processloop(unknown source) @ sun.security.ssl.handshaker.process_record(unknown source) @ sun.security.ssl.sslsocketimpl.readrecord(unknown source) @ sun.security.ssl.sslsocketimpl.performinitialhandshake(unknown source) @ sun.security.ssl.sslsocketimpl.starthandshake(unknown source) @ sun.security.ssl.sslsocketimpl.starthandshake(unknown source) @ org.apache.axis.components.net.jssesocketfactory.create(jssesocketfactory.java:186) @ org.apache.axis.transport.http.httpsender.getsocket(httpsender.java:191) @ org.apache.axis.transport.http.httpsender.writetosocket(httpsender.java:404) @ org.apache.axis.transport.http.httpsender.invoke(httpsender.java:138) @ org.apache.axis.strategies.invocationstrategy.visit(invocationstrategy.java:32) @ org.apache.axis.simplechain.dovisiting(simplechain.java:118) @ org.apache.axis.simplechain.invoke(simplechain.java:83) @ org.apache.axis.client.axisclient.invoke(axisclient.java:165) @ org.apache.axis.client.call.invokeengine(call.java:2784) @ org.apache.axis.client.call.invoke(call.java:2767) @ org.apache.axis.client.call.invoke(call.java:2443) @ org.apache.axis.client.call.invoke(call.java:2366) @ org.apache.axis.client.call.invoke(call.java:1812) @ org.wso2.carbon.andes.admin.andesadminservicesoap11bindingstub.getallqueues(andesadminservicesoap11bindingstub.java:858) @ org.wso2.carbon.andes.admin.andesadminserviceporttypeproxy.getallqueues(andesadminserviceporttypeproxy.java:62) @ org.wso2.carbon.andes.admin.testclass.main(testclass.java:11) caused by: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.validator.pkixvalidator.dobuild(unknown source) @ sun.security.validator.pkixvalidator.enginevalidate(unknown source) @ sun.security.validator.validator.validate(unknown source) @ sun.security.ssl.x509trustmanagerimpl.validate(unknown source) @ sun.security.ssl.x509trustmanagerimpl.checktrusted(unknown source) @ sun.security.ssl.x509trustmanagerimpl.checkservertrusted(unknown source) ... 24 more caused by: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.provider.certpath.suncertpathbuilder.build(unknown source) @ sun.security.provider.certpath.suncertpathbuilder.enginebuild(unknown source) @ java.security.cert.certpathbuilder.build(unknown source) ... 30 more {http://xml.apache.org/axis/}hostname:ril15066yjb152 javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ org.apache.axis.axisfault.makefault(axisfault.java:101) @ org.apache.axis.transport.http.httpsender.invoke(httpsender.java:154) @ org.apache.axis.strategies.invocationstrategy.visit(invocationstrategy.java:32) @ org.apache.axis.simplechain.dovisiting(simplechain.java:118) @ org.apache.axis.simplechain.invoke(simplechain.java:83) @ org.apache.axis.client.axisclient.invoke(axisclient.java:165) @ org.apache.axis.client.call.invokeengine(call.java:2784) @ org.apache.axis.client.call.invoke(call.java:2767) @ org.apache.axis.client.call.invoke(call.java:2443) @ org.apache.axis.client.call.invoke(call.java:2366) @ org.apache.axis.client.call.invoke(call.java:1812) @ org.wso2.carbon.andes.admin.andesadminservicesoap11bindingstub.getallqueues(andesadminservicesoap11bindingstub.java:858) @ org.wso2.carbon.andes.admin.andesadminserviceporttypeproxy.getallqueues(andesadminserviceporttypeproxy.java:62) @ org.wso2.carbon.andes.admin.testclass.main(testclass.java:11) caused by: javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.ssl.alerts.getsslexception(unknown source) @ sun.security.ssl.sslsocketimpl.fatal(unknown source) @ sun.security.ssl.handshaker.fatalse(unknown source) @ sun.security.ssl.handshaker.fatalse(unknown source) @ sun.security.ssl.clienthandshaker.servercertificate(unknown source) @ sun.security.ssl.clienthandshaker.processmessage(unknown source) @ sun.security.ssl.handshaker.processloop(unknown source) @ sun.security.ssl.handshaker.process_record(unknown source) @ sun.security.ssl.sslsocketimpl.readrecord(unknown source) @ sun.security.ssl.sslsocketimpl.performinitialhandshake(unknown source) @ sun.security.ssl.sslsocketimpl.starthandshake(unknown source) @ sun.security.ssl.sslsocketimpl.starthandshake(unknown source) @ org.apache.axis.components.net.jssesocketfactory.create(jssesocketfactory.java:186) @ org.apache.axis.transport.http.httpsender.getsocket(httpsender.java:191) @ org.apache.axis.transport.http.httpsender.writetosocket(httpsender.java:404) @ org.apache.axis.transport.http.httpsender.invoke(httpsender.java:138) ... 12 more caused by: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.validator.pkixvalidator.dobuild(unknown source) @ sun.security.validator.pkixvalidator.enginevalidate(unknown source) @ sun.security.validator.validator.validate(unknown source) @ sun.security.ssl.x509trustmanagerimpl.validate(unknown source) @ sun.security.ssl.x509trustmanagerimpl.checktrusted(unknown source) @ sun.security.ssl.x509trustmanagerimpl.checkservertrusted(unknown source) ... 24 more caused by: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.provider.certpath.suncertpathbuilder.build(unknown source) @ sun.security.provider.certpath.suncertpathbuilder.enginebuild(unknown source) @ java.security.cert.certpathbuilder.build(unknown source) ... 30 more
my api call getallqueues() method -
package org.wso2.carbon.andes.admin; import java.rmi.remoteexception; public class testclass { public static void main(string args[]) { andesadminservicesoap11bindingstub aadptp; andesadminservicelocator loact = new andesadminservicelocator(); try { aadptp = new andesadminservicesoap11bindingstub(); aadptp._setproperty(org.apache.axis.client.stub.username_property, "admin"); aadptp._setproperty(org.apache.axis.client.stub.password_property, "admin"); aadptp._setproperty(org.apache.axis.client.stub.endpoint_address_property, loact.getandesadminservicehttpssoap11endpointaddress()); org.wso2.carbon.andes.admin.internal.xsd.queue[] queues = aadptp.getallqueues(); system.out.println(queues.length); } catch (axisfault e1) { e1.printstacktrace(); } catch (remoteexception e) { e.printstacktrace(); } } }
first, please try access endpoint soapui or other preferred tool you. if access it, sounds need add wso2 certificate jvm key store.
wso2 products using custom key store located @ ${carbon.home}/repository/resources/security/
directory. if need access https endpoint in wso2 server java client, need add certificate keystore file of used jvm located @ `${java_home}/lib/security/cacerts'.
first can check if certificate in keystore running following command: keytool -list -keystore "${java_home}/lib/security/cacerts"
(you don't need provide password)
if certificate missing, add keystore following command:
keytool -import -noprompt -trustcacerts -alias wso2carbon -file ${carbon.home}/repository/resources/security/ -keystore ${java_home}/lib/security/cacerts -storepass wso2carbon
Comments
Post a Comment