Hi, today I tried to use the new release of spring flex with spring security 3.
Once configured I got a exception:
Error creating bean with name '_messageBrokerDefaultHandlerMapping':
Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption:
Error creating bean with name '_messageBroker':
Cannot resolve reference to bean '_messageBrokerEndpointProcessor' while setting bean property 'configProcessors' with key [3];
nested exception is org.springframework.beans.factory.BeanCreationExce ption:
Error creating bean with name '_messageBrokerEndpointProcessor':
Cannot resolve reference to bean 'org.springframework.flex.core.EndpointServiceMess agePointcutAdvisor#1' while setting constructor argument with key [1];
nested exception is org.springframework.beans.factory.BeanCreationExce ption:
Error creating bean with name 'org.springframework.flex.core.EndpointServiceMess agePointcutAdvisor#1':
Cannot resolve reference to bean 'org.springframework.flex.core.MessageInterception Advice#0' while setting constructor argument;
nested exception is org.springframework.beans.factory.BeanCreationExce ption:
Error creating bean with name 'org.springframework.flex.core.MessageInterception Advice#0':
Cannot resolve reference to bean 'org.springframework.flex.security3.EndpointInterc eptor#0' while setting bean property 'messageInterceptors' with key [1];
nested exception is org.springframework.beans.factory.BeanCreationExce ption:
Error creating bean with name 'org.springframework.flex.security3.EndpointInterc eptor#0':
Invocation of init method failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException:
No unique bean of type [org.springframework.security.access.AccessDecision Manager] is defined: expected single bean but found 2:
org.springframework.security.access.vote.Affirmati veBased#0,org.springframework.security.access.vote .AffirmativeBased#1
My security config:
My spring-flex config:HTML Code:<sec:http entry-point-ref="authenticationEntryPoint" > <sec:anonymous enabled="false"/> </sec:http> <bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint"/> <sec:authentication-manager> <sec:authentication-provider user-service-ref='AuthenticationJDBC'> <sec:password-encoder hash="sha" /> </sec:authentication-provider> </sec:authentication-manager> <bean id="AuthenticationJDBC" class="org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl"> <property name="dataSource" ref="dataSource" /> </bean> <sec:global-method-security secured-annotations="enabled" jsr250-annotations="enabled"/>
Reading the logs I found that spring creates two AccessDecisionManager, AffirmativeBased#0 and AffirmativeBased#1, the last appears to be related with the JDBCDao authentication-provider.HTML Code:<flex:message-broker> <flex:exception-translator ref="mySecurityExceptionTranslator" /> <flex:secured> <flex:secured-channel channel="my-amf" access="ROLE_USER" /> <flex:secured-channel channel="my-secure-amf" access="ROLE_USER" /> </flex:secured> </flex:message-broker>
To solve I have to set manually:
...
<flex:secured access-decision-manager="org.springframework.security.access.vote. AffirmativeBased#1">
...
Is the creation of two AccessDecisionManager the right behavior? Spring-flex can't discover the right AccessDecisionManager through authentication-manager? There is anotther way to workaround this problem?
Sorry for my bad english.
-- Victor


Reply With Quote
