InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
经历两次报错,都耗时很久解决,本地可以部署到服务器就不行
第一次、工程中连接域,在对域进行认证时报错
第二次、工程中调用webservice接口,https接口。
报错原因:证书没有正确设置。linux服务器的路径和本地win的路径不同,导致没有办法正确找到证书。
以为为linux的设置。
String keystore = LdapUtils.class.getResource("").toString().substring(6).replace("%20", " ")+"cacerts";
System.setProperty("javax.net.ssl.trustStore","/"+keystore);