在 Glassfish 中出现“无法找到请求目标的有效认证路径”,但在独立 Java 应用程序中却没有出现

问题描述 投票:0回答:1

使用 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

如何解决?

java certificate glassfish
1个回答
0
投票

这是适用于我的情况的解决方案:

EDGE 资源管理器,我必须访问 WSDL URL 并导出证书

将其移至Glassfishconfig路径(C:\PROYECT\glassfish4\glassfish\domains\domain

© www.soinside.com 2019 - 2024. All rights reserved.