[mule-user] Mule 2 WS Security

0 views
Skip to first unread message

mlilianaga

unread,
Sep 2, 2008, 7:39:48 PM9/2/08
to us...@mule.codehaus.org

I am trying to create a Secure WS in Mule 2, but I don't know if it is
configured correctly

I added to mule config xml this lines

<cxf:connector name="cxfConnector">
<spring:property name="configurationLocation" value="wss-cxf-config.xml"
/>
</cxf:connector>

The model is configured as a component

<model name="wsSecure">
<service name="serviceWSSecurity">
<inbound>
<cxf:inbound-endpoint address="http://localhost:8081/services/"/>
</inbound>
<component>
<spring-object bean="WSSecurityImpl"/>
</component>
</service>
</model>

wss-cxf-config.xml file is configured

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

<jaxws:server name="{namespace}ServicePort" createdFromAPI="true">
<jaxws:inInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="Signature Encrypt" />
<entry key="passwordCallbackRef"
value-ref="serverCallback"/>
<entry key="user" value="alias"/>
<entry key="decryptionPropFile"
value="server.crypto.properties"/>
<entry key="signaturePropFile"
value="server.crypto.properties"/>
</map>
</constructor-arg>
</bean>
</jaxws:inInterceptors>
</jaxws:server>

<bean id="serverCallback" class="PwdCallBack"/>
</beans>


But when I call the service the result is the same as when I call the
service without cxfConnector.


Thanks for your help.

:working:

--
View this message in context: http://www.nabble.com/Mule-2-WS-Security-tp19280467p19280467.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Antoine Borg

unread,
Sep 4, 2008, 4:42:43 AM9/4/08
to us...@mule.codehaus.org
Hi,

There is some info on the wiki about WS-Security for CXF but the config
seems to be Mule 1.x config. Perhaps it will help:
http://mule.mulesource.org/display/MULE2USER/Enabling+WS-Security

Regards


Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoin...@ricston.com | blog: blog.ricston.com | web: ricston.com

mlilianaga

unread,
Sep 4, 2008, 10:34:48 AM9/4/08
to us...@mule.codehaus.org

Hi

Thanks for your help


I am testing the service but appears the next error

ERROR 2008-09-04 09:28:15,024 [main] org.mule.MuleServer:
********************************************************************************
Message : Initialisation Failure: Error creating bean with
name '{http://localhost:8081/services/}RecibirResultadosValidacionImplPort':
Cannot create inner bean
'org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor#e1dac2' of type
[org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] while setting bean
property 'inInterceptors' with key [1]; nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] for bean with
name 'org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor#e1dac2' defined in
class path resource [wss-cxf-config.xml]; nested exception is
java.lang.ClassNotFoundException:
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
Type : org.mule.api.lifecycle.InitialisationException
Code : MULE_ERROR-72085
JavaDoc :
http://mule.mulesource.org/docs/apidocs/org/mule/api/lifecycle/InitialisationException.html
Object : CxfMessageReceiver{this=19855ed,
receiverKey=http://localhost:8081/services/ServiceResultadoValidacionCIFIN,
endpoint=http://localhost:8081/services/ServiceResultadoValidacionCIFIN}
********************************************************************************
Exception stack is:
1. org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
(java.lang.ClassNotFoundException)
java.net.URLClassLoader$1:-1 (null)
2. Cannot find class [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
for bean with name
'org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor#e1dac2' defined in
class path resource [wss-cxf-config.xml]; nested exception is
java.lang.ClassNotFoundException:
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
(org.springframework.beans.factory.CannotLoadBeanClassException)
org.springframework.beans.factory.support.AbstractBeanFactory:1138 (null)
3. Error creating bean with name
'{http://localhost:8081/services/}RecibirResultadosValidacionImplPort':
Cannot create inner bean
'org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor#e1dac2' of type
[org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] while setting bean
property 'inInterceptors' with key [1]; nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] for bean with
name 'org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor#e1dac2' defined in
class path resource [wss-cxf-config.xml]; nested exception is
java.lang.ClassNotFoundException:
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
(org.springframework.beans.factory.BeanCreationException)
org.springframework.beans.factory.support.BeanDefinitionValueResolver:230
(null)
4. Initialisation Failure: Error creating bean with name
'{http://localhost:8081/services/}RecibirResultadosValidacionImplPort':
Cannot create inner bean
'org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor#e1dac2' of type
[org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] while setting bean
property 'inInterceptors' with key [1]; nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] for bean with
name 'org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor#e1dac2' defined in
class path resource [wss-cxf-config.xml]; nested exception is
java.lang.ClassNotFoundException:
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
(org.mule.api.lifecycle.InitialisationException)
org.mule.transport.cxf.CxfMessageReceiver:240
(http://mule.mulesource.org/docs/apidocs/org/mule/api/lifecycle/InitialisationException.html)
********************************************************************************
Root Exception stack trace:
java.lang.ClassNotFoundException:
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
at
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:381)
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1135)
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1102)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:386)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1244)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.configureBean(AbstractAutowireCapableBeanFactory.java:283)
at
org.springframework.beans.factory.wiring.BeanConfigurerSupport.configureBean(BeanConfigurerSupport.java:155)
at
org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:114)
at
org.mule.transport.cxf.CxfMessageReceiver.doInitialise(CxfMessageReceiver.java:223)
at
org.mule.transport.AbstractMessageReceiver.initialise(AbstractMessageReceiver.java:159)
at
org.mule.transport.AbstractConnector.registerListener(AbstractConnector.java:1020)
at
org.mule.service.AbstractService.registerListeners(AbstractService.java:608)
at org.mule.service.AbstractService.start(AbstractService.java:316)
at org.mule.service.AbstractService.start(AbstractService.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.mule.lifecycle.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:263)
at
org.mule.lifecycle.DefaultLifecyclePhase.fireLifecycle(DefaultLifecyclePhase.java:119)
at
org.mule.lifecycle.GenericLifecycleManager.firePhase(GenericLifecycleManager.java:79)
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:147)
at org.mule.MuleServer.run(MuleServer.java:254)
at org.mule.MuleServer.start(MuleServer.java:239)
at org.mule.MuleServer.main(MuleServer.java:116)

********************************************************************************

ERROR 2008-09-04 09:28:15,071 [main] org.mule.MuleServer:
********************************************************************************
* A Fatal error has occurred while the server was running:
*
* org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
*
* (java.lang.ClassNotFoundException)
*
*
*
* The error is fatal, the system must shutdown
*
* Server started: 31/12/69 19:00
*
* Server shutdown: 4/09/08 9:28
*
********************************************************************************


antoine.borg wrote:
>
> Hi,
>
> There is some info on the wiki about WS-Security for CXF but the config
> seems to be Mule 1.x config. Perhaps it will help:
> http://mule.mulesource.org/display/MULE2USER/Enabling+WS-Security
>
> Regards
>
>
> Antoine Borg, Senior Consultant | Tel: +32 28 504 696
> ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
> email: antoin...@ricston.com | blog: blog.ricston.com | web:
> ricston.com
>
> -----Original Message-----
> From: mlilianaga [mailto:mogon...@i-siglo21.com]
> Sent: Wednesday, September 03, 2008 1:40 AM
> To: us...@mule.codehaus.org
> Subject: [mule-user] Mule 2 WS Security
>
>

--
View this message in context: http://www.nabble.com/Mule-2-WS-Security-tp19280467p19309780.html

mlilianaga

unread,
Sep 4, 2008, 5:24:05 PM9/4/08
to us...@mule.codehaus.org

Andrew Perepelytsya

unread,
Sep 5, 2008, 9:16:23 AM9/5/08
to us...@mule.codehaus.org
java.lang.
ClassNotFoundException:
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor

Missing some cxf jars. Drop it in $MULE_HOME/lib/user

Andrew

mlilianaga

unread,
Sep 5, 2008, 9:20:06 AM9/5/08
to us...@mule.codehaus.org

Thanks for your help the missing jar was cxf-rt-ws-security-2.1.2.jar

Andrew Perepelytsya wrote:
>
>>
>> java.lang.ClassNotFoundException:


>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
>>
>
> Missing some cxf jars. Drop it in $MULE_HOME/lib/user
>
> Andrew
>
>

--
View this message in context: http://www.nabble.com/Mule-2-WS-Security-tp19280467p19331104.html

Reply all
Reply to author
Forward
0 new messages