2013-06-27 4 views
1

Apache Axis2에 포함 된 WSDL2Java.bat를 사용하여 온라인 SOAP WSDL 서비스에서 .java 파일을 생성하지만 일부 인증서에 대한 오류가 발생합니다. 나는 이것이 어디에서 왔는지 모릅니다. 그것은 제가 주어진 지시에 따라 작동해야합니다.WSDL2Java 인증서 오류

Using AXIS2_HOME: C:\Users\****\Downloads\axis2-1.6.2-bin\axis2-1.6.2 
Using JAVA_HOME: C:\Program Files\Java\jre7 
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException 
: Error parsing WSDL 
     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat 
ionEngine.java:181) 
     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) 
     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) 
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.Validator 
Exception: PKIX path building failed: sun.security.provider.certpath.SunCertPath 
BuilderException: unable to find valid certification path to requested target 
     at sun.security.ssl.Alerts.getSSLException(Unknown Source) 
     at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source) 
     at sun.security.ssl.Handshaker.fatalSE(Unknown Source) 
     at sun.security.ssl.Handshaker.fatalSE(Unknown Source) 
     at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source) 
     at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source) 
     at sun.security.ssl.Handshaker.processLoop(Unknown Source) 
     at sun.security.ssl.Handshaker.process_record(Unknown Source) 
     at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) 
     at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source 
) 
     at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) 
     at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) 
     at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source) 
     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect 
(Unknown Source) 
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So 
urce) 
     at java.net.HttpURLConnection.getResponseCode(Unknown Source) 
     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unk 
nown Source) 
     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat 
ionEngine.java:99) 
     ... 2 more 
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali 
d certification path to requested target 
     at sun.security.validator.PKIXValidator.doBuild(Unknown Source) 
     at sun.security.validator.PKIXValidator.engineValidate(Unknown Source) 
     at sun.security.validator.Validator.validate(Unknown Source) 
     at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source) 
     at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) 
     at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Sour 
ce) 
     ... 16 more 
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to 
find valid certification path to requested target 
     at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown 
Source) 
     at java.security.cert.CertPathBuilder.build(Unknown Source) 
     ... 22 more 

누구나 문제가 될 수있는 부분에 대해 힌트를 얻었습니다.

감사

답변

3

당신이 HTTPS URL에서 WSDL을 사용하여 Java 클래스를 생성하려고하는 것 같다. 인증서의 유효성을 검사 할 때 실패합니다.

브라우저에서 WSDL에 액세스하면 경고 메시지가 표시됩니다.

WSDL을 로컬 디렉토리에 저장하고 해당 파일에 대해 WSDL2Java를 실행할 수 있습니다.

그러나 엔드 포인트가 HTTPS URL 인 경우 스텁을 통해 웹 서비스에 액세스 할 때 유사한 오류가 발생할 수 있습니다.

+1

감사합니다. 예. 수동으로 .wsdl 파일에 저장하여 작동 시켰습니다. 그러나 올바른 인증서를 추가하고 "set JAVA_OPTS = -Djavax.net.ssl.trustStore = C :/Path/to/certificate"를 실행 한 다음 HTTPS 소스에서 Java 파일을 생성하여 작동시킬 수도있었습니다. –

+0

그게 좋습니다! 문제를 해결할 수있어서 기쁩니다! –