You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by kk31 <kr...@yahoo.com> on 2013/02/01 20:25:37 UTC

running samples sts from cxf 2.5 throwing error

Hi,
  I am pretty much new to apache cxf. I am planning to work on STS 
samplethat was bundled with apache-cxf-2.7.2
    I have followed the instructions, and setup maven,jdk 1.6. when
following read me instructions and try to run mvn -Pclient, i am getting the
following error msg in in the cmd.

    I haven't changed anything the sample, simply try to run the sample sts.

INFO: Creating Service {http://apache.org/hello_world_soap_http}SOAPService
from
 WSDL: file:/C:/Documents%20and%20Settings/My%20Documents/Downloads/apa
che-cxf-2.7.2/samples/sts/wsdl/hello_world.wsdl
Invoking greetMe...
Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLoggi
ng
WARNING: Interceptor for
{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Secu
rityTokenService#{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Issue
has th
rown exception, unwinding now
org.apache.cxf.interceptor.Fault: Cannot encrypt data
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.handleBinding(SymmetricBindingHandler.java:124)
        at
org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
ava:162)
        at
org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
ava:89)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:271)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
        at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
ient.java:760)
        at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
ient.java:638)
        at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
ient.java:630)
        at
org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide
r.java:406)
        at
org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider.
java:189)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:271)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
        at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13
3)
        at $Proxy38.greetMe(Unknown Source)
        at demo.wssec.client.Client.main(Client.java:72)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde
r.policyNotAsserted(AbstractBindingBuilder.java:291)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doEncryptionDerived(SymmetricBindingHandler.java:490)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doEncryption(SymmetricBindingHandler.java:507)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389)
        ... 28 more
Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLoggi
ng
WARNING: Interceptor for
{http://apache.org/hello_world_soap_http}SOAPService#{h
ttp://apache.org/hello_world_soap_http}greetMe has thrown exception,
unwinding n
ow
org.apache.cxf.interceptor.Fault: Cannot encrypt data
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.handleBinding(SymmetricBindingHandler.java:124)
        at
org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
ava:162)
        at
org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
ava:89)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:271)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
        at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
ient.java:760)
        at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
ient.java:638)
        at
org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
ient.java:630)
        at
org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide
r.java:406)
        at
org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider.
java:189)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:271)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
        at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13
3)
        at $Proxy38.greetMe(Unknown Source)
        at demo.wssec.client.Client.main(Client.java:72)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde
r.policyNotAsserted(AbstractBindingBuilder.java:291)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doEncryptionDerived(SymmetricBindingHandler.java:490)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doEncryption(SymmetricBindingHandler.java:507)
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389)
        ... 28 more
Invocation failed with the following:
org.apache.cxf.ws.policy.PolicyException:
Cannot encrypt data


          Can any one help me how to fix this issue















--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by kk31 <kr...@yahoo.com>.
Hi,
   I got to know that wireshark is not much useful if the calls are in
localhost(127.0.0.1) . Since both my WSP ,STS and WSC are running in single
machine.
     So the only option is to use log4j stuff, but not sure how can i apply
it this sample
   
      I have couple of questions, please bear with me, if they are stupid
questions.

1. When STS generates the saml token, how do i control, whether
authorization assertion or authentication assertions statements should be
generated
.
2. How can we specify to sign only authorization assertions statement only

3. How can we connect to ldap and verify the client user credentials and
what are the attributes he has and updated in the authentication and
authorization assertions

4. How does the  WSP will validate the STS, the saml token generated is
valid during particular period of time

 Thanks
 kk




--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722813.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by Glen Mazza <gm...@talend.com>.
I use Wireshark for that: 
http://www.jroller.com/gmazza/entry/soap_calls_over_wireshark, but that 
can also be done within CXF: 
https://cwiki.apache.org/CXF20DOC/debugging-and-logging.html

Glen

On 02/01/2013 05:38 PM, kk31 wrote:
>
> Thanks it worked for me :) i am able to get the response. Is there any way i can see the actual requests & responses over the wire/logs from
>
> 1. Client to STS
> 2. STS to Client with the token
> 3. from Client(with token) to WSP
> 4. WSP validates the token with  STS
> 5. STS to WSP
> 6. the actual response from WSP to WSC
>
>
>
> --kk
>
> ________________________________
>   From: Glen Mazza (Talend) [via CXF] <ml...@n5.nabble.com>
> To: kk31 <kr...@yahoo.com>
> Sent: Friday, February 1, 2013 4:14 PM
> Subject: Re: running samples sts from  cxf 2.5 throwing error
>   
>
> You'll be replacing those files...those are the non-JCE versions (they
> have the same names but they have less data in them).  You will need to
> replace those files with the same named ones in the JCE download.
>
> Glen
>
> On 02/01/2013 04:56 PM, kk31 wrote:
>
>> I am using win 32 , i have installed jdk 7, went to program files>java>jre7>jce>    in this folder, already whatever the jar files available in JCE zip file, those are already there in the program files>java>jre7>jce> location.
>>
>>
>>
>>
>> ________________________________
>>    From: Glen Mazza (Talend) [via CXF] <[hidden email]>
>> To: kk31 <[hidden email]>
>> Sent: Friday, February 1, 2013 3:48 PM
>> Subject: Re: running samples sts from  cxf 2.5 throwing error
>>    
>>
>> I'm not sure how that could be--Oracle normally requires you to manually
>> install it.  Are you sure you have the JCE installed?  How do you know?
>>
>> Glen
>>
>> On 02/01/2013 04:41 PM, kk31 wrote:
>>> I have installed JDK7 which by default having the JCE setting.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: running samples sts from cxf 2.5 throwing error

Posted by kk31 <kr...@yahoo.com>.

Thanks it worked for me :) i am able to get the response. Is there any way i can see the actual requests & responses over the wire/logs from 

1. Client to STS
2. STS to Client with the token
3. from Client(with token) to WSP
4. WSP validates the token with  STS
5. STS to WSP
6. the actual response from WSP to WSC



--kk

________________________________
 From: Glen Mazza (Talend) [via CXF] <ml...@n5.nabble.com>
To: kk31 <kr...@yahoo.com> 
Sent: Friday, February 1, 2013 4:14 PM
Subject: Re: running samples sts from  cxf 2.5 throwing error
 

You'll be replacing those files...those are the non-JCE versions (they 
have the same names but they have less data in them).  You will need to 
replace those files with the same named ones in the JCE download. 

Glen 

On 02/01/2013 04:56 PM, kk31 wrote: 

> 
> I am using win 32 , i have installed jdk 7, went to program files>java>jre7>jce>    in this folder, already whatever the jar files available in JCE zip file, those are already there in the program files>java>jre7>jce> location. 
> 
> 
> 
> 
> ________________________________ 
>   From: Glen Mazza (Talend) [via CXF] <[hidden email]> 
> To: kk31 <[hidden email]> 
> Sent: Friday, February 1, 2013 3:48 PM 
> Subject: Re: running samples sts from  cxf 2.5 throwing error 
>   
> 
> I'm not sure how that could be--Oracle normally requires you to manually 
> install it.  Are you sure you have the JCE installed?  How do you know? 
> 
> Glen 
> 
> On 02/01/2013 04:41 PM, kk31 wrote: 
>> I have installed JDK7 which by default having the JCE setting. 
> 

-- 
Glen Mazza 
Talend Community Coders - coders.talend.com 
blog: www.jroller.com/gmazza 



________________________________
 
If you reply to this email, your message will be added to the discussion below:
http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722630.html 
To unsubscribe from running samples sts from  cxf 2.5 throwing error, click here.
NAML



--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722631.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by Glen Mazza <gm...@talend.com>.
You'll be replacing those files...those are the non-JCE versions (they 
have the same names but they have less data in them).  You will need to 
replace those files with the same named ones in the JCE download.

Glen

On 02/01/2013 04:56 PM, kk31 wrote:
>
> I am using win 32 , i have installed jdk 7, went to program files>java>jre7>jce>    in this folder, already whatever the jar files available in JCE zip file, those are already there in the program files>java>jre7>jce> location.
>
>
>
>
> ________________________________
>   From: Glen Mazza (Talend) [via CXF] <ml...@n5.nabble.com>
> To: kk31 <kr...@yahoo.com>
> Sent: Friday, February 1, 2013 3:48 PM
> Subject: Re: running samples sts from  cxf 2.5 throwing error
>   
>
> I'm not sure how that could be--Oracle normally requires you to manually
> install it.  Are you sure you have the JCE installed?  How do you know?
>
> Glen
>
> On 02/01/2013 04:41 PM, kk31 wrote:
>> I have installed JDK7 which by default having the JCE setting.
>


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: running samples sts from cxf 2.5 throwing error

Posted by kk31 <kr...@yahoo.com>.

I am using win 32 , i have installed jdk 7, went to program files>java>jre7>jce>    in this folder, already whatever the jar files available in JCE zip file, those are already there in the program files>java>jre7>jce> location.




________________________________
 From: Glen Mazza (Talend) [via CXF] <ml...@n5.nabble.com>
To: kk31 <kr...@yahoo.com> 
Sent: Friday, February 1, 2013 3:48 PM
Subject: Re: running samples sts from  cxf 2.5 throwing error
 

I'm not sure how that could be--Oracle normally requires you to manually 
install it.  Are you sure you have the JCE installed?  How do you know? 

Glen 

On 02/01/2013 04:41 PM, kk31 wrote: 
> I have installed JDK7 which by default having the JCE setting. 


-- 
Glen Mazza 
Talend Community Coders - coders.talend.com 
blog: www.jroller.com/gmazza 



________________________________
 
If you reply to this email, your message will be added to the discussion below:
http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722627.html 
To unsubscribe from running samples sts from  cxf 2.5 throwing error, click here.
NAML



--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722629.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by Glen Mazza <gm...@talend.com>.
I'm not sure how that could be--Oracle normally requires you to manually 
install it.  Are you sure you have the JCE installed?  How do you know?

Glen

On 02/01/2013 04:41 PM, kk31 wrote:
> I have installed JDK7 which by default having the JCE setting.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: running samples sts from cxf 2.5 throwing error

Posted by kk31 <kr...@yahoo.com>.
I have installed JDK7 which by default having the JCE setting. Any how i
downloaded the JCE and update JDK 7 once again, restarted my machine and run
the sample once again.
    I got the same problem.  Is there any configuration files, i have to
change 




--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722625.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by kk31 <kr...@yahoo.com>.
I have installed JDK7 which by default having the JCE setting with unlimited
encryption strength. Any how i downloaded the JCE and update JDK 7 once
again, restarted my machine and run the sample once again. 
    I got the same problem.  Is there any configuration files, i have to
change ?


Here is the starting of the msg

WARNING: Interceptor for
{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Secu
rityTokenService#{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Issue
has th
rown exception, unwinding now
org.apache.cxf.interceptor.Fault: Cannot encrypt data
        at
org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395)


    why its getting encrypted, any settings i have to change?



--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722628.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by Glen Mazza <gm...@talend.com>.
Yes, per the sample's README unlimited strength is required (and 
available in both JDK 6 and 7), just follow the simple readme within the 
Oracle unlimited strength download for installation instructions.

Glen

On 02/01/2013 04:21 PM, Daniel Kulp wrote:
> On Feb 1, 2013, at 4:16 PM, kk31 <kr...@yahoo.com> wrote:
>
>> I am installing jdk 1.7, will try to run once again.
>>
>> Dan,
>>    Can you please explain little bit more, what's do mean by unlimited
>> strength of encryption stuff which is not available on JDK 6.
>>         May be its huge topic, but in short what are the things missing in
>> jdk 6
> By default, the JDK's from Oracle have limited strength encryption built in.  Large key sizes, certain algorithms, etc… won't work.   It has to do with export restrictions or something.   If you go to:
>
> http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
>
> you can download replacement security things for the JRE which allows the stronger algorithms.
>
>


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: running samples sts from cxf 2.5 throwing error

Posted by Daniel Kulp <dk...@apache.org>.
On Feb 1, 2013, at 4:16 PM, kk31 <kr...@yahoo.com> wrote:

> I am installing jdk 1.7, will try to run once again. 
> 
> Dan,
>   Can you please explain little bit more, what's do mean by unlimited
> strength of encryption stuff which is not available on JDK 6.
>        May be its huge topic, but in short what are the things missing in
> jdk 6 

By default, the JDK's from Oracle have limited strength encryption built in.  Large key sizes, certain algorithms, etc… won't work.   It has to do with export restrictions or something.   If you go to:

http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html

you can download replacement security things for the JRE which allows the stronger algorithms.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: running samples sts from cxf 2.5 throwing error

Posted by kk31 <kr...@yahoo.com>.
I am installing jdk 1.7, will try to run once again. 

Dan,
   Can you please explain little bit more, what's do mean by unlimited
strength of encryption stuff which is not available on JDK 6.
        May be its huge topic, but in short what are the things missing in
jdk 6 



--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722622.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by Daniel Kulp <dk...@apache.org>.
On Feb 1, 2013, at 3:57 PM, kk31 <kr...@yahoo.com> wrote:

> I am sorry its typo error. I have used both 2.5 and 2.7 versions both are having same issues. i got the same problem

Do either of you know if the STS sample requires the unlimited strength encryption stuff?    My gut feeling is that Glen has those installed which is why it may be working for him.

Dan



> 
> 
> ________________________________
> From: Glen Mazza (Talend) [via CXF] <ml...@n5.nabble.com>
> To: kk31 <kr...@yahoo.com> 
> Sent: Friday, February 1, 2013 2:51 PM
> Subject: Re: running samples sts from  cxf 2.5 throwing error
> 
> 
> Your subject line says CXF 2.5, but I'm assuming you're using 2.7.2 as 
> you've written below.  When I followed the sts sample README 
> instructions with CXF 2.7.2, namely: 
> 
>    mvn install (builds the demo) 
>    mvn -Psts  (from one command line window) 
>    mvn -Pserver  (from a second command line window) 
>    mvn -Pclient  (from a third command line window) 
> 
> 
> It worked fine for me (although I use JDK7).  Do an "mvn clean install" 
> for subsequent runs. 
> 
> If you're using CXF 2.5.x, use the sample provided with that version 
> instead (we have an sts sample there too).  We don't/can't guarantee 
> backwards compatibility across major versions. 
> 
> HTH, 
> Glen 
> 
> On 02/01/2013 02:25 PM, kk31 wrote: 
> 
>> Hi, 
>>    I am pretty much new to apache cxf. I am planning to work on STS 
>> samplethat was bundled with apache-cxf-2.7.2 
>>      I have followed the instructions, and setup maven,jdk 1.6. when 
>> following read me instructions and try to run mvn -Pclient, i am getting the 
>> following error msg in in the cmd. 
>> 
>>      I haven't changed anything the sample, simply try to run the sample sts. 
>> 
>> INFO: Creating Service {http://apache.org/hello_world_soap_http}SOAPService 
>> from 
>>   WSDL:file:/C:/Documents%20and%20Settings/My%20Documents/Downloads/apa 
>> che-cxf-2.7.2/samples/sts/wsdl/hello_world.wsdl 
>> Invoking greetMe... 
>> Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain 
>> doDefaultLoggi 
>> ng 
>> WARNING: Interceptor for 
>> {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Secu 
>> rityTokenService#{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Issue 
>> has th 
>> rown exception, unwinding now 
>> org.apache.cxf.interceptor.Fault: Cannot encrypt data 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.handleBinding(SymmetricBindingHandler.java:124) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
>> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
>> ava:162) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
>> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
>> ava:89) 
>>          at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
>> orChain.java:271) 
>>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>>          at 
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
>> ient.java:760) 
>>          at 
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
>> ient.java:638) 
>>          at 
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
>> ient.java:630) 
>>          at 
>> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
>> Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide 
>> r.java:406) 
>>          at 
>> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
>> Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider. 
>> java:189) 
>>          at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
>> orChain.java:271) 
>>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>>          at 
>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
>>          at 
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13 
>> 3) 
>>          at $Proxy38.greetMe(Unknown Source) 
>>          at demo.wssec.client.Client.main(Client.java:72) 
>>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
>>          at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. 
>> java:39) 
>>          at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces 
>> sorImpl.java:25) 
>>          at java.lang.reflect.Method.invoke(Method.java:597) 
>>          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291) 
>>          at java.lang.Thread.run(Thread.java:662) 
>> Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde 
>> r.policyNotAsserted(AbstractBindingBuilder.java:291) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doEncryptionDerived(SymmetricBindingHandler.java:490) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doEncryption(SymmetricBindingHandler.java:507) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389) 
>>          ... 28 more 
>> Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain 
>> doDefaultLoggi 
>> ng 
>> WARNING: Interceptor for 
>> {http://apache.org/hello_world_soap_http}SOAPService#{h 
>> ttp://apache.org/hello_world_soap_http}greetMe has thrown exception, 
>> unwinding n 
>> ow 
>> org.apache.cxf.interceptor.Fault: Cannot encrypt data 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.handleBinding(SymmetricBindingHandler.java:124) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
>> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
>> ava:162) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
>> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
>> ava:89) 
>>          at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
>> orChain.java:271) 
>>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>>          at 
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
>> ient.java:760) 
>>          at 
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
>> ient.java:638) 
>>          at 
>> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
>> ient.java:630) 
>>          at 
>> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
>> Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide 
>> r.java:406) 
>>          at 
>> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
>> Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider. 
>> java:189) 
>>          at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
>> orChain.java:271) 
>>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>>          at 
>> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
>>          at 
>> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13 
>> 3) 
>>          at $Proxy38.greetMe(Unknown Source) 
>>          at demo.wssec.client.Client.main(Client.java:72) 
>>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
>>          at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. 
>> java:39) 
>>          at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces 
>> sorImpl.java:25) 
>>          at java.lang.reflect.Method.invoke(Method.java:597) 
>>          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291) 
>>          at java.lang.Thread.run(Thread.java:662) 
>> Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde 
>> r.policyNotAsserted(AbstractBindingBuilder.java:291) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doEncryptionDerived(SymmetricBindingHandler.java:490) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doEncryption(SymmetricBindingHandler.java:507) 
>>          at 
>> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
>> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389) 
>>          ... 28 more 
>> Invocation failed with the following: 
>> org.apache.cxf.ws.policy.PolicyException: 
>> Cannot encrypt data 
>> 
>> 
>>            Can any one help me how to fix this issue 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context:http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616.html
>> Sent from the cxf-user mailing list archive at Nabble.com. 
> 
> -- 
> Glen Mazza 
> Talend Community Coders - coders.talend.com 
> blog:www.jroller.com/gmazza 
> 
> 
> 
> ________________________________
> 
> If you reply to this email, your message will be added to the discussion below:http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722619.html 
> To unsubscribe from running samples sts from  cxf 2.5 throwing error, click here.
> NAML
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722620.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: running samples sts from cxf 2.5 throwing error

Posted by kk31 <kr...@yahoo.com>.
I am sorry its typo error. I have used both 2.5 and 2.7 versions both are having same issues. i got the same problem


________________________________
 From: Glen Mazza (Talend) [via CXF] <ml...@n5.nabble.com>
To: kk31 <kr...@yahoo.com> 
Sent: Friday, February 1, 2013 2:51 PM
Subject: Re: running samples sts from  cxf 2.5 throwing error
 

Your subject line says CXF 2.5, but I'm assuming you're using 2.7.2 as 
you've written below.  When I followed the sts sample README 
instructions with CXF 2.7.2, namely: 

   mvn install (builds the demo) 
   mvn -Psts  (from one command line window) 
   mvn -Pserver  (from a second command line window) 
   mvn -Pclient  (from a third command line window) 


It worked fine for me (although I use JDK7).  Do an "mvn clean install" 
for subsequent runs. 

If you're using CXF 2.5.x, use the sample provided with that version 
instead (we have an sts sample there too).  We don't/can't guarantee 
backwards compatibility across major versions. 

HTH, 
Glen 

On 02/01/2013 02:25 PM, kk31 wrote: 

> Hi, 
>    I am pretty much new to apache cxf. I am planning to work on STS 
> samplethat was bundled with apache-cxf-2.7.2 
>      I have followed the instructions, and setup maven,jdk 1.6. when 
> following read me instructions and try to run mvn -Pclient, i am getting the 
> following error msg in in the cmd. 
> 
>      I haven't changed anything the sample, simply try to run the sample sts. 
> 
> INFO: Creating Service {http://apache.org/hello_world_soap_http}SOAPService 
> from 
>   WSDL:file:/C:/Documents%20and%20Settings/My%20Documents/Downloads/apa 
> che-cxf-2.7.2/samples/sts/wsdl/hello_world.wsdl 
> Invoking greetMe... 
> Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain 
> doDefaultLoggi 
> ng 
> WARNING: Interceptor for 
> {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Secu 
> rityTokenService#{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Issue 
> has th 
> rown exception, unwinding now 
> org.apache.cxf.interceptor.Fault: Cannot encrypt data 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.handleBinding(SymmetricBindingHandler.java:124) 
>          at 
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
> ava:162) 
>          at 
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
> ava:89) 
>          at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
> orChain.java:271) 
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>          at 
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
> ient.java:760) 
>          at 
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
> ient.java:638) 
>          at 
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
> ient.java:630) 
>          at 
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
> Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide 
> r.java:406) 
>          at 
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
> Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider. 
> java:189) 
>          at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
> orChain.java:271) 
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>          at 
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
>          at 
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13 
> 3) 
>          at $Proxy38.greetMe(Unknown Source) 
>          at demo.wssec.client.Client.main(Client.java:72) 
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. 
> java:39) 
>          at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces 
> sorImpl.java:25) 
>          at java.lang.reflect.Method.invoke(Method.java:597) 
>          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291) 
>          at java.lang.Thread.run(Thread.java:662) 
> Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde 
> r.policyNotAsserted(AbstractBindingBuilder.java:291) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doEncryptionDerived(SymmetricBindingHandler.java:490) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doEncryption(SymmetricBindingHandler.java:507) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389) 
>          ... 28 more 
> Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain 
> doDefaultLoggi 
> ng 
> WARNING: Interceptor for 
> {http://apache.org/hello_world_soap_http}SOAPService#{h 
> ttp://apache.org/hello_world_soap_http}greetMe has thrown exception, 
> unwinding n 
> ow 
> org.apache.cxf.interceptor.Fault: Cannot encrypt data 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.handleBinding(SymmetricBindingHandler.java:124) 
>          at 
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
> ava:162) 
>          at 
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic 
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j 
> ava:89) 
>          at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
> orChain.java:271) 
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>          at 
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
> ient.java:760) 
>          at 
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
> ient.java:638) 
>          at 
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl 
> ient.java:630) 
>          at 
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
> Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide 
> r.java:406) 
>          at 
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor 
> Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider. 
> java:189) 
>          at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept 
> orChain.java:271) 
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) 
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) 
>          at 
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
>          at 
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13 
> 3) 
>          at $Proxy38.greetMe(Unknown Source) 
>          at demo.wssec.client.Client.main(Client.java:72) 
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. 
> java:39) 
>          at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces 
> sorImpl.java:25) 
>          at java.lang.reflect.Method.invoke(Method.java:597) 
>          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291) 
>          at java.lang.Thread.run(Thread.java:662) 
> Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde 
> r.policyNotAsserted(AbstractBindingBuilder.java:291) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doEncryptionDerived(SymmetricBindingHandler.java:490) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doEncryption(SymmetricBindingHandler.java:507) 
>          at 
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl 
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389) 
>          ... 28 more 
> Invocation failed with the following: 
> org.apache.cxf.ws.policy.PolicyException: 
> Cannot encrypt data 
> 
> 
>            Can any one help me how to fix this issue 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> View this message in context:http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616.html
> Sent from the cxf-user mailing list archive at Nabble.com. 

-- 
Glen Mazza 
Talend Community Coders - coders.talend.com 
blog:www.jroller.com/gmazza 



________________________________
 
If you reply to this email, your message will be added to the discussion below:http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722619.html 
To unsubscribe from running samples sts from  cxf 2.5 throwing error, click here.
NAML



--
View this message in context: http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616p5722620.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: running samples sts from cxf 2.5 throwing error

Posted by Glen Mazza <gm...@talend.com>.
Your subject line says CXF 2.5, but I'm assuming you're using 2.7.2 as 
you've written below.  When I followed the sts sample README 
instructions with CXF 2.7.2, namely:

   mvn install (builds the demo)
   mvn -Psts  (from one command line window)
   mvn -Pserver  (from a second command line window)
   mvn -Pclient  (from a third command line window)


It worked fine for me (although I use JDK7).  Do an "mvn clean install" 
for subsequent runs.

If you're using CXF 2.5.x, use the sample provided with that version 
instead (we have an sts sample there too).  We don't/can't guarantee 
backwards compatibility across major versions.

HTH,
Glen

On 02/01/2013 02:25 PM, kk31 wrote:
> Hi,
>    I am pretty much new to apache cxf. I am planning to work on STS
> samplethat was bundled with apache-cxf-2.7.2
>      I have followed the instructions, and setup maven,jdk 1.6. when
> following read me instructions and try to run mvn -Pclient, i am getting the
> following error msg in in the cmd.
>
>      I haven't changed anything the sample, simply try to run the sample sts.
>
> INFO: Creating Service {http://apache.org/hello_world_soap_http}SOAPService
> from
>   WSDL:file:/C:/Documents%20and%20Settings/My%20Documents/Downloads/apa
> che-cxf-2.7.2/samples/sts/wsdl/hello_world.wsdl
> Invoking greetMe...
> Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain
> doDefaultLoggi
> ng
> WARNING: Interceptor for
> {http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Secu
> rityTokenService#{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Issue
> has th
> rown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Cannot encrypt data
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.handleBinding(SymmetricBindingHandler.java:124)
>          at
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
> ava:162)
>          at
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
> ava:89)
>          at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
> orChain.java:271)
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
>          at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> ient.java:760)
>          at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> ient.java:638)
>          at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> ient.java:630)
>          at
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
> Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide
> r.java:406)
>          at
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
> Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider.
> java:189)
>          at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
> orChain.java:271)
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
>          at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
>          at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13
> 3)
>          at $Proxy38.greetMe(Unknown Source)
>          at demo.wssec.client.Client.main(Client.java:72)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>          at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>          at java.lang.reflect.Method.invoke(Method.java:597)
>          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
>          at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde
> r.policyNotAsserted(AbstractBindingBuilder.java:291)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doEncryptionDerived(SymmetricBindingHandler.java:490)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doEncryption(SymmetricBindingHandler.java:507)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389)
>          ... 28 more
> Feb 1, 2013 1:18:37 PM org.apache.cxf.phase.PhaseInterceptorChain
> doDefaultLoggi
> ng
> WARNING: Interceptor for
> {http://apache.org/hello_world_soap_http}SOAPService#{h
> ttp://apache.org/hello_world_soap_http}greetMe has thrown exception,
> unwinding n
> ow
> org.apache.cxf.interceptor.Fault: Cannot encrypt data
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:395)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.handleBinding(SymmetricBindingHandler.java:124)
>          at
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
> ava:162)
>          at
> org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$Polic
> yBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.j
> ava:89)
>          at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
> orChain.java:271)
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
>          at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> ient.java:760)
>          at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> ient.java:638)
>          at
> org.apache.cxf.ws.security.trust.STSClient.requestSecurityToken(STSCl
> ient.java:630)
>          at
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
> Provider$IssuedTokenOutInterceptor.getTokenFromSTS(IssuedTokenInterceptorProvide
> r.java:406)
>          at
> org.apache.cxf.ws.security.policy.interceptors.IssuedTokenInterceptor
> Provider$IssuedTokenOutInterceptor.handleMessage(IssuedTokenInterceptorProvider.
> java:189)
>          at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
> orChain.java:271)
>          at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
>          at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
>          at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
>          at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13
> 3)
>          at $Proxy38.greetMe(Unknown Source)
>          at demo.wssec.client.Client.main(Client.java:72)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>          at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>          at java.lang.reflect.Method.invoke(Method.java:597)
>          at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
>          at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.cxf.ws.policy.PolicyException: Cannot encrypt data
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilde
> r.policyNotAsserted(AbstractBindingBuilder.java:291)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doEncryptionDerived(SymmetricBindingHandler.java:490)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doEncryption(SymmetricBindingHandler.java:507)
>          at
> org.apache.cxf.ws.security.wss4j.policyhandlers.SymmetricBindingHandl
> er.doSignBeforeEncrypt(SymmetricBindingHandler.java:389)
>          ... 28 more
> Invocation failed with the following:
> org.apache.cxf.ws.policy.PolicyException:
> Cannot encrypt data
>
>
>            Can any one help me how to fix this issue
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:http://cxf.547215.n5.nabble.com/running-samples-sts-from-cxf-2-5-throwing-error-tp5722616.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog:www.jroller.com/gmazza