You were absolutely right, changing "useReqSigCert" on the client side solved 
my problem.
Thank you for your help!

Márton Horváth
________________________________________
Feladó: Colm O hEigeartaigh [cohei...@apache.org]
Küldve: 2013. július 4. 12:13
To: users@cxf.apache.org
Tárgy: Re: NullPointerException when encrypting an outbound message

The problem is that you are configuring the encryption user as the special
"useReqSigCert" value. This is only valid on the receiving side, as it
means that the certificate to be used to encrypt the response to the
message initiator is taken from the signature of the received message. So
if you are configuring the client with this value, then this is incorrect.

Colm.


On Thu, Jul 4, 2013 at 11:21 AM, Horváth Márton <marton.horv...@corvex.hu>wrote:

> Hello,
>
> I'm trying to get WS-Security working with CXF (2.7.4) but I'm stuck with
> a problem: when the client tries to send a message to the server the
> encryption of the message fails with a NullPointerException. The stacktrace
> is the following:
>
> Caused by: java.lang.NullPointerException: null at
> org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.setEncryptionUser(AbstractBindingBuilder.java:1622)
> ~[cxf-rt-ws-security-2.7.4.jar:2.7.4] at
> org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doEncryption(AsymmetricBindingHandler.java:411)
> ~[cxf-rt-ws-security-2.7.4.jar:2.7.4] at
> org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doSignBeforeEncrypt(AsymmetricBindingHandler.java:190)
> ~[cxf-rt-ws-security-2.7.4.jar:2.7.4]
>
> The code line indicated to throw the exception in the stacktrace is the
> following:
>
> List<WSHandlerResult> results = CastUtils.cast((List<?>)
> message.getExchange().getInMessage().get(WSHandlerConstants.RECV_RESULTS));
>
> The debug showed that the .getInMessage() returns null which is ok I think
> as there wasn't any inbound message before. This is a bug in the wss4j
> implementation or I misconfigured something?
> Thanks for you help!
>
> Best regards,
> Márton Horváth
>



--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Reply via email to