The problem appears to be that your keystore only contains the certificate
and not the private key:
Alias name: devstore
Creation date: 17/01/2018
Entry type: trustedCertEntry
^^^^^^^^^^^^^^^^
Instead you need an entry of type "PrivateKeyEntry" to get the private key
with which to sign the message.
Colm.
On Wed, Jan 17, 2018 at 8:45 AM, Al Grant <[email protected]> wrote:
> I have tried this for my callbackhandler class, but still get a error:
>
> public class ClientCallbackHandler implements CallbackHandler {
>
> public void handle(Callback[] callbacks) {
> for (Callback callback : callbacks) {
> WSPasswordCallback pc = (WSPasswordCallback) callback;
> if (pc.getIdentifier().equals("devstore")) {
> pc.setPassword("mysecret");
> return;
> }
> }
> }
> }
>
> I still get:
>
> WARNING: Interceptor for
> {http://tempuri.org/}Service#{urn:***.****.**/schema/common}Set***** has
> thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Security processing failed.
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$
> WSS4JOutInterceptorInternal.handleMessageInternal(
> WSS4JOutInterceptor.java:272)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$
> WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:136)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$
> WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:123)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:308)
> 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:139)
> at com.sun.proxy.$Proxy39.setEpisode(Unknown Source)
> at com.CmsExport.createEpisode(CmsExport.java:113)
> at com.JFrameTest.writefiletoDB(JFrameTest.java:180)
> at com.JFrameTest$FileWorkerThread.run(JFrameTest.java:994)
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: Error during
> Signature:
> Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
> Cannot find key for alias: [devstore]
> Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
> Cannot find key for alias: [devstore]
> at
> org.apache.wss4j.dom.action.SignatureAction.execute(
> SignatureAction.java:163)
> at
> org.apache.wss4j.dom.handler.WSHandler.doSenderAction(WSHandler.java:238)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor.access$100(
> WSS4JOutInterceptor.java:55)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$
> WSS4JOutInterceptorInternal.handleMessageInternal(
> WSS4JOutInterceptor.java:264)
> ... 13 more
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: Cannot find
> key
> for alias: [devstore]
> Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
> Cannot find key for alias: [devstore]
> at
> org.apache.wss4j.dom.message.WSSecSignature.computeSignature(
> WSSecSignature.java:595)
> at
> org.apache.wss4j.dom.action.SignatureAction.execute(
> SignatureAction.java:155)
> ... 16 more
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: Cannot find
> key
> for alias: [devstore]
> at org.apache.wss4j.common.crypto.Merlin.getPrivateKey(
> Merlin.java:728)
> at
> org.apache.wss4j.dom.message.WSSecSignature.computeSignature(
> WSSecSignature.java:538)
> ... 17 more
>
> Exception in thread "Thread-2" javax.xml.ws.soap.SOAPFaultException:
> Security processing failed.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
> JaxWsClientProxy.java:161)
> at com.sun.proxy.$Proxy39.setEpisode(Unknown Source)
> at com.CmsExport.createEpisode(CmsExport.java:113)
> at com.JFrameTest.writefiletoDB(JFrameTest.java:180)
> at com.JFrameTest$FileWorkerThread.run(JFrameTest.java:994)
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: Error during
> Signature:
> Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
> Cannot find key for alias: [devstore]
> Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
> Cannot find key for alias: [devstore]
> at
> org.apache.wss4j.dom.action.SignatureAction.execute(
> SignatureAction.java:163)
> at
> org.apache.wss4j.dom.handler.WSHandler.doSenderAction(WSHandler.java:238)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor.access$100(
> WSS4JOutInterceptor.java:55)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$
> WSS4JOutInterceptorInternal.handleMessageInternal(
> WSS4JOutInterceptor.java:264)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$
> WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:136)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor$
> WSS4JOutInterceptorInternal.handleMessage(WSS4JOutInterceptor.java:123)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> PhaseInterceptorChain.java:308)
> 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:139)
> ... 4 more
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: Cannot find
> key
> for alias: [devstore]
> Original Exception was org.apache.wss4j.common.ext.WSSecurityException:
> Cannot find key for alias: [devstore]
> at
> org.apache.wss4j.dom.message.WSSecSignature.computeSignature(
> WSSecSignature.java:595)
> at
> org.apache.wss4j.dom.action.SignatureAction.execute(
> SignatureAction.java:155)
> ... 16 more
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: Cannot find
> key
> for alias: [devstore]
> at org.apache.wss4j.common.crypto.Merlin.getPrivateKey(
> Merlin.java:728)
> at
> org.apache.wss4j.dom.message.WSSecSignature.computeSignature(
> WSSecSignature.java:538)
> ... 17 more
>
>
>
> --
> Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com