현재 스프링 플렉스 통합을 사용하고 있으며 스프링을 통해 보안이 유지 된 웹 서비스를 추가하려고합니다.이름이 '_loginCommandPostProcessor'인 bean을 생성하는 중 오류가 발생했습니다.
이렇게하려면 두 개의 HTTP 태그를 만들려고합니까?
봄 보안-config.xml에 나는 다음과 같은 오류 받고 있어요
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
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-4.3.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd">
<context:component-scan base-package="com.somenamespace.login" />
<context:annotation-config/>
<beans:bean id="entryPoint"
class="org.springframework.flex.security4.FlexAuthenticationEntryPoint"/>
<http entry-point-ref="entryPoint" pattern="/messagebroker/**">
<intercept-url pattern="/**" access="authenticated"/>
<custom-filter position="FORM_LOGIN_FILTER" ref="myAuthFilter" />
<session-management session-authentication-strategy-ref="sas"/>
</http>
<http pattern="*">
<intercept-url pattern="/**" access="authenticated"/>
<http-basic />
<custom-filter position="FORM_LOGIN_FILTER" ref="myAuthFilter" />
<session-management session-authentication-strategy-ref="sas"/>
</http>
<beans:bean id="myAuthFilter" class=
"org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
<beans:property name="sessionAuthenticationStrategy" ref="sas" />
<beans:property name="authenticationManager" ref="authenticationManager" />
</beans:bean>
<beans:bean id="sas" class="org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy" />
<beans:bean id="switchUserProcessingFilter" class="org.springframework.security.web.authentication.switchuser.SwitchUserFilter">
<beans:property name="userDetailsService" ref="customAuthenticationProvider"/>
<beans:property name="switchUserUrl" value="/admin/impersonate"/>
<beans:property name="targetUrl" value="/cre/CRE.html"/>
<beans:property name="switchFailureUrl" value="/admin/switchUser"/>
</beans:bean>
<beans:bean id="defaultMessageTemplate" class="org.springframework.flex.messaging.MessageTemplate" />
<beans:bean id="customAuthenticationProvider" class="com.somenamespace.login.CustomAuthenticationProvider"/>
<authentication-manager alias="authenticationManager">
<authentication-provider ref="customAuthenticationProvider"/> <
</authentication-manager>
</beans:beans>
: -
Error creating bean with name '_loginCommandPostProcessor': Unsatisfied dependency expressed through bean property 'sessionAuthenticationStrategy'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.security.web.authentication.session.SessionAuthenticationStrategy' available: expected single matching bean but found 3: org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy#0,org.springframework.security.web.authentication.session.CompositeSessionAuthenticationStrategy#1,sas
'sas'와는 달리 스프링 컨텍스트에서 초기화 된 2 개의 bean이 있음을 분명히 알 수 있습니다. 'org.springframework.security.web.authentication.session'을 검사하지 않습니까? 다른 XML 파일에서 선언 될 수 있습니다. –
그게 무슨 뜻인지 잘 모르겠습니다. 내가 스캔하지 않도록하려면 어떻게해야합니까? – DangeRuss
답변을 가능한 해결책으로 아래에 답변으로 게시했습니다. 제발,보세요. –