Ola pessoal, boa noite.
Estou com problema no envio de NF-e… O erro ocorre na instancia do serviço:
.
.
.
URL url = null;
try {
url = new URL("https://homologacao.nfe.sefaz.rs.gov.br/ws/Nferecepcao/NFeRecepcao2.asmx");
} catch (MalformedURLException ex) {
Logger.getLogger(teste.class.getName()).log(Level.SEVERE, null, ex);
}
System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
System.setProperty("javax.net.ssl.keyStore", keystore);
System.setProperty("javax.net.ssl.keyStorePassword", senhaKeystore);
System.setProperty("javax.net.ssl.trustStoreType", "JKS");
System.setProperty("javax.net.ssl.trustStore", trustStore);
System.setProperty("javax.net.ssl.trustStorePassword", senhaTrustStore);
try {
NfeRecepcao2 servico = new NfeRecepcao2(url); // aqui ocorre o erro
NfeRecepcao2Soap12 soap = servico.getNfeRecepcao2Soap12();
NfeRecepcaoLote2Result result = soap.nfeRecepcaoLote2(dados);
} catch (Throwable ex) {
Logger.getLogger(teste.class.getName()).log(Level.SEVERE, null, ex);
}
Erro que ocorre:
(com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException) com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException.
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
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
Em todos os foruns dizem ser problema no certificado ou cadeia certificadora, mas eu configurei tudo certo e nada…
Alguem sabe se tem algum pulo do gato ai pra funcionar???