[mule-user] Problem with configuring spring security manager

25 views
Skip to first unread message

Ryan Crichton

unread,
Feb 15, 2012, 7:56:21 AM2/15/12
to us...@mule.codehaus.org
Hi,

I am trying to configure some basic HTTP authentication over HTTPS. I have got this working previously and I have it pretty much working now with one major problem. I get the error below when my flow tries to write the message to a VM queue. My mule config works fine if I remove the the security filter (<http:basic-security-filter realm="mule-realm"/>) line but as soon as this line is present I get the error below.

Any help will be much appreciated, I have run out of ideas...

Thanks,
Ryan

*From the log:*

INFO 2012-02-15 14:41:09,565 [[rhea_interoperability_layer_v2].HTTPSConnector.receiver.02] org.mule.api.processor.LoggerMessageProcessor: Structured message: RestfulHttpRequest {
url: ws/rest/v1/facilities
body: null
requestParms: [
sector: Musha
type: test
]} Full Message:
org.mule.DefaultMuleMessage
{
id=55616432-57d2-11e1-bc96-bfcb48d13544
payload=org.jembi.rhea.RestfulHttpRequest
correlationId=<not set>
correlationGroup=-1
correlationSeq=-1
encoding=UTF-8
exceptionPayload=<not set>

Message properties:
INVOCATION scoped properties:
queries=merged: {insertMsg=insert into inbound_messages (payload, timestamp) values (#[groovy: return message.payload.toString();], now());}
queryTimeout=-1
INBOUND scoped properties:
Accept-Encoding=gzip,deflate
Authorization=Basic YWRtaW46YWRtaW4=
Connection=false
Host=localhost:5000
Keep-Alive=false
MULE_ORIGINATING_ENDPOINT=endpoint.https.localhost.5000
MULE_REMOTE_CLIENT_ADDRESS=/127.0.0.1:43335
User-Agent=Jakarta Commons-HttpClient/3.1
http.context.path=/
http.method=GET
http.request=/ws/rest/v1/facilities?sector=Musha&type=test
http.request.path=/ws/rest/v1/facilities
http.version=HTTP/1.1
sector=Musha
type=test
OUTBOUND scoped properties:
MULE_ENCODING=UTF-8
MULE_ENDPOINT=jdbc://insertMsg
MULE_ROOT_MESSAGE_ID=55616432-57d2-11e1-bc96-bfcb48d13544
SESSION scoped properties:
}
ERROR 2012-02-15 14:41:09,591 [[rhea_interoperability_layer_v2].HTTPSConnector.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of OutboundEndpoint 'vm://normalizationQueue' request chain'
[
org.mule.endpoint.outbound.OutboundEventTimeoutMessageProcessor,
org.mule.endpoint.outbound.OutboundSessionHandlerMessageProcessor,
org.mule.endpoint.outbound.OutboundEndpointPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundRootMessageIdPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundResponsePropertiesMessageProcessor
]" with transaction "Transaction{factory=null, action=INDIFFERENT, timeout=0}".. Message payload is of type: RestfulHttpRequest
Code : MULE_ERROR-29999
--------------------------------------------------------------------------------
Exception stack is:
1. org.mule.config.spring.parsers.assembly.MapEntryCombiner (java.io.NotSerializableException)
java.io.ObjectOutputStream:1180 (null)
2. java.io.NotSerializableException: org.mule.config.spring.parsers.assembly.MapEntryCombiner (org.apache.commons.lang.SerializationException)
org.apache.commons.lang.SerializationUtils:111 (null)
3. An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of OutboundEndpoint 'vm://normalizationQueue' request chain'
[
org.mule.endpoint.outbound.OutboundEventTimeoutMessageProcessor,
org.mule.endpoint.outbound.OutboundSessionHandlerMessageProcessor,
org.mule.endpoint.outbound.OutboundEndpointPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundRootMessageIdPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundResponsePropertiesMessageProcessor
]" with transaction "Transaction{factory=null, action=INDIFFERENT, timeout=0}".. Message payload is of type: RestfulHttpRequest (org.mule.api.MessagingException)
org.mule.processor.TransactionalInterceptingMessageProcessor:63 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.NotSerializableException: org.mule.config.spring.parsers.assembly.MapEntryCombiner
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at java.util.ArrayList.writeObject(ArrayList.java:673)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

*My flow config*

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security" xmlns:ss="http://www.springframework.org/schema/security" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.1/mule-spring-security.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd ">
<mule-ss:security-manager>
<mule-ss:delegate-security-provider name="memory-provider" delegate-ref="authenticationManager"/>
</mule-ss:security-manager>
<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="admin" password="admin" authorities="ROLE_ADMIN"/>
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
<spring:bean id="jdbcDataSource" name="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" doc:name="jdbcDataSource">
<spring:property name="password" value="${db.password}"/>
<spring:property name="user" value="${db.user}"/>
<spring:property name="url" value="${db.url}"/>
<spring:property name="driverName" value="${db.driverName}"/>
</spring:bean>
</spring:beans>
<context:property-placeholder xmlns:context="http://www.springframework.org/schema/context" location="classpath:my.properties"></context:property-placeholder>
<jdbc:connector name="JDBCConnector" dataSource-ref="jdbcDataSource" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="JDBCConnector"/>
<https:connector name="HTTPSConnector" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" proxyHostname="localhost" proxyPort="80" doc:name="HTTPSConnector">
<https:tls-key-store path="keystore.jks" keyPassword="Jembi#123" storePassword="Jembi#123"/>
</https:connector>
<flow name="RESTEntryPoint" doc:name="RESTEntryPoint">
<https:inbound-endpoint exchange-pattern="request-response" host="localhost" port="5000" connector-ref="HTTPSConnector" doc:name="HTTP">
<http:basic-security-filter realm="mule-realm"/>
</https:inbound-endpoint>
<response>
<custom-transformer class="org.jembi.rhea.transformers.RestfulHttpResponseToHttpResponseTransformer" doc:name="RestfulHttpResponseToHttpResponseTransformer"/>
<logger message="Transaction responce sent from entry point: #[groovy:return message.toString();] with payload #[groovy:return message.payload.toString();]" level="INFO" doc:name="Logger"/>
</response>
<logger message="Message recieved at entry point: #[groovy:return message.toString();] with payload #[groovy:return message.payload.toString();]" level="INFO" doc:name="Log raw message"/>
<custom-transformer class="org.jembi.rhea.transformers.HttpRequestToRestfulHttpRequestTransformer" doc:name="HttpRequestToRestfulHttpRequestTransformer"/>
<logger message="Structured message: #[groovy: message.payload.toString();]" level="INFO" doc:name="Log Structured Message"/>
<jdbc:outbound-endpoint exchange-pattern="request-response" queryKey="insertMsg" responseTimeout="10000" queryTimeout="-1" connector-ref="JDBCConnector" doc:name="Persist raw message">
<jdbc:query key="insertMsg" value="insert into inbound_messages (payload, timestamp) values (#[groovy: return message.payload.toString();], now());"/>
</jdbc:outbound-endpoint>
<choice doc:name="Choice">
<when expression="message.getInboundProperty('X-SENDING-APP') != null" evaluator="groovy">
<processor-chain>
<logger message="Propagating sending app header" level="INFO" doc:name="Log propagate sending app header"/>
<message-properties-transformer doc:name="Propagate sending app header">
<add-message-property key="X-SENDING-APP" value="#[header:inbound:X-SENDING-APP]"/>
</message-properties-transformer>
</processor-chain>
</when>
<otherwise>
<processor-chain>
<logger message="No sending app header detected" level="INFO" doc:name="Log no sending app header"/>
</processor-chain>
</otherwise>
</choice>
<message-properties-transformer doc:name="Message Properties">
<delete-message-property key="LOCAL_CERTIFICATES"/>
</message-properties-transformer>
<logger message="Structured message: #[groovy: message.payload.toString();] Full Message: #[groovy: message.toString();]" level="INFO" doc:name="Log Structured Message"/>
<vm:outbound-endpoint exchange-pattern="request-response" path="normalizationQueue" responseTimeout="10000" mimeType="text/plain" doc:name="Queue message"/>
</flow>
</mule>

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

http://xircles.codehaus.org/manage_email


Reply all
Reply to author
Forward
0 new messages