意外错误: java.security.InvalidAlgorithmParameterException: trustAnchors 参数必须为非空
2022-09-03 15:38:39
嗨,
我写了一个java代码,它连接到Salesforce并在那里更新一个值,当我从本地系统作为独立的java应用程序运行它时,它运行得很好,但我的主要目标是将其作为filenet BPM工作流中的java组件,所以当工作流进程到达这个java组件时,它会抛出一个错误作为标题
整个堆栈堆栈跟踪如下
com.sforce.ws.ConnectionException: Failed to send request to https://login.salesforce.com/services/Soap/c/24.0/0DF90000000PX8r
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:129)
at com.sforce.soap.enterprise.EnterpriseConnection.login(EnterpriseConnection.java:1052)
at com.sforce.soap.enterprise.EnterpriseConnection.<init>(EnterpriseConnection.java:399)
at salesforceupdate.SalesForceUpdate.main(SalesForceUpdate.java:70)
at salesforceupdate.Callin.UpdateSL(Callin.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at filenet.vw.integrator.adaptors.java.VWJavaAdaptor.execute(VWJavaAdaptor.java:426)
at filenet.vw.integrator.base.VWAdaptorEx$AdaptorAction.run(VWAdaptorEx.java:120)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:727)
at filenet.vw.integrator.base.VWAdaptorEx.run(VWAdaptorEx.java:360)
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at com.ibm.jsse2.n.a(n.java:42)
at com.ibm.jsse2.tc.a(tc.java:96)
at com.ibm.jsse2.tc.a(tc.java:340)
at com.ibm.jsse2.tc.a(tc.java:555)
at com.ibm.jsse2.tc.a(tc.java:510)
at com.ibm.jsse2.tc.startHandshake(tc.java:381)
at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:151)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:64)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1024)
at com.ibm.net.ssl.www2.protocol.https.b.getOutputStream(b.java:51)
at com.sforce.ws.transport.JdkHttpTransport.connectRaw(JdkHttpTransport.java:115)
at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:79)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:107)
... 13 more
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at com.ibm.jsse2.util.e.<init>(e.java:117)
at com.ibm.jsse2.util.d.a(d.java:20)
at com.ibm.jsse2.hc.a(hc.java:58)
at com.ibm.jsse2.hc.checkServerTrusted(hc.java:88)
at filenet.ws.utils.jsse.FnTrustManager.checkServerTrusted(FnTrustManager.java:156)
at com.ibm.jsse2.hb.a(hb.java:382)
at com.ibm.jsse2.hb.a(hb.java:23)
at com.ibm.jsse2.gb.n(gb.java:295)
at com.ibm.jsse2.gb.a(gb.java:269)
at com.ibm.jsse2.tc.a(tc.java:347)
at com.ibm.jsse2.tc.g(tc.java:416)
at com.ibm.jsse2.tc.a(tc.java:60)
... 21 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:287)
at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:143)
at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:101)
at com.ibm.jsse2.util.e.<init>(e.java:17)
... 32 more
我已经谷歌了有关此错误的所有内容,并生成了域的.crt文件并创建了一个密钥库文件,并在我的代码中提到了这一点
System.setProperty("javax.net.ssl.trustStore","C:\\Program Files\\IBM\\WebSphere\\AppServer\\java\\jre\\bin\\secure.ts");
System.setProperty("javax.net.ssl.trustStorePassword", "xxxxx");
顺便说一句,我甚至修改了WAS控制台中的密钥管理网和证书
但是我一直得到同样的错误。不知道该怎么办,任何帮助都会很棒
提前致谢