使用 Eclipse IDE,给出以下类,我从中省略了所有不必要的内容:
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceClient;
//...
@WebServiceClient
public class CustomService extends Service {
public CustomService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
//...
}
当从另一个独立类的“main”方法调用它时,当通过行super(wsdlLocation,serviceName)时,它可以正常工作。
但是,当从 Glassfish 加载时执行的类调用它时,当通过行 super(wsdlLocation, serviceName) 时,它会抛出以下异常:
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
如何解决?