当我在client-config.wsdl中为BulkPanquery定义(wss4j)不同的PropartiesFiles时,我使用不同的证书定义了不同的密钥库,我能够拥有不同的发送和接收证书。但是当我使用相同的signaturePropFiles'使用相同的密钥库。我在尝试发送消息时收到此消息:
<bean id="ServiceName1" class="<ClassName Path>">
</bean>
<bean id="ServiceName2" class="<ClassName Path>">
</bean>
我对两个有关Client.Proparties的证书都有相同的密码
我的属性文件:
Invocation failed with the following:
org.apache.wss4j.common.ext.WSSecurityException: Cannot find key for alias:
[sha]
Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
Cannot find key for alias: [sha]
javax.xml.ws.soap.SOAPFaultException: Cannot find key for alias: [sha]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:160)
at com.sun.proxy.$Proxy35.uploadBulkPan(Unknown Source)
at bulkPanService.BulkPanService_Client.main(BulkPanService_Client.java:34)
Caused by: org.apache.wss4j.common.ext.WSSecurityException: Cannot find key
for alias: [sha]
Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
Cannot find key for alias: [sha]
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:138)
... 2 more
Caused by: org.apache.wss4j.common.ext.WSSecurityException: Cannot find key
for alias: [sha]
at org.apache.wss4j.common.crypto.Merlin.getPrivateKey(Merlin.java:745)
答案 0 :(得分:0)
注意堆栈跟踪的最后一部分。
org.apache.wss4j.common.crypto.Merlin.getPrivateKey
这很清楚地表明您在Java密钥库中引用的别名缺少私有密钥。您最有可能是指别名,即没有私钥的证书。
您可以将证书或GitHub上的代码链接发送给我吗?