无法将类型的值转换为属性所需的类型' userDetailsS​​ervice':找不到匹配的编辑器或转换策略

时间:2015-01-23 15:52:25

标签: spring security userdetailsservice

我在加载spring安全上下文时遇到异常。

2015-01-23 10:10:22,008 INFO  [STDOUT] (main) 10:10:22,008 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
2015-01-23 10:10:22,168 INFO  [STDOUT] (main) 10:10:22,168 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [services2.xml]
2015-01-23 10:10:22,188 INFO  [STDOUT] (main) 10:10:22,188 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [../../config/common/common-services.xml]
2015-01-23 10:10:22,278 INFO  [STDOUT] (main) 10:10:22,278 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [../lib/MYAPP-MAIN-DATA-CLIENT.jar/client-resources/spring_client_beans.xml]
2015-01-23 10:10:22,508 INFO  [STDOUT] (main) 10:10:22,508 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext-security.xml]
2015-01-23 10:10:22,548 INFO  [STDOUT] (main) 10:10:22,548 INFO  [SpringSecurityCoreVersion] You are running with Spring Security Core 3.1.2.RELEASE
2015-01-23 10:10:22,548 INFO  [STDOUT] (main) 10:10:22,548 INFO  [SecurityNamespaceHandler] Spring Security 'config' module version is 3.1.2.RELEASE
2015-01-23 10:10:22,598 INFO  [STDOUT] (main) 10:10:22,598 INFO  [GlobalMethodSecurityBeanDefinitionParser] Expressions were enabled for method security but no SecurityExpressionHandler was configured. All hasPermision() expressions will evaluate to false.
2015-01-23 10:10:22,708 INFO  [STDOUT] (main) 10:10:22,708 INFO  [HttpSecurityBeanDefinitionParser] Checking sorted filter chain: [Root bean: class [org.springframework.security.web.access.channel.ChannelProcessingFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 100, Root bean: class [org.springframework.security.web.context.SecurityContextPersistenceFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 300, <customExceptionTranslationFilter>, order = 599, <customFilter>, order = 600, Root bean: class [org.springframework.security.web.savedrequest.RequestCacheAwareFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1300, Root bean: class [org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1400, Root bean: class [org.springframework.security.web.authentication.AnonymousAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1700, Root bean: class [org.springframework.security.web.session.SessionManagementFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1800, Root bean: class [org.springframework.security.web.access.ExceptionTranslationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1900, <org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0>, order = 2000]
2015-01-23 10:10:23,594 INFO  [STDOUT] (main) 10:10:23,594 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@71b625af: defining beans [mimeTypeMap,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,mainUserService,org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler#0,org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor#0,org.springframework.security.methodSecurityMetadataSourceAdvisor,org.springframework.aop.config.internalAutoProxyCreator,customUserDetailsService,springSecurityFilterChain,customFilter,customExceptionTranslationFilter,preauthAuthProvider,http403EntryPoint,org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.DefaultSecurityFilterChain#0,org.springframework.security.web.DefaultSecurityFilterChain#1,org.springframework.security.web.DefaultSecurityFilterChain#2,org.springframework.security.web.DefaultSecurityFilterChain#3,org.springframework.security.web.DefaultSecurityFilterChain#4,org.springframework.security.web.DefaultSecurityFilterChain#5,org.springframework.security.web.DefaultSecurityFilterChain#6,org.springframework.security.web.DefaultSecurityFilterChain#7,org.springframework.security.web.DefaultSecurityFilterChain#8,org.springframework.security.web.DefaultSecurityFilterChain#9,org.springframework.security.web.DefaultSecurityFilterChain#10,org.springframework.security.web.DefaultSecurityFilterChain#11,org.springframework.security.web.DefaultSecurityFilterChain#12,org.springframework.security.web.DefaultSecurityFilterChain#13,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.web.PortResolverImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.access.channel.ChannelDecisionManagerImpl#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#1,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#14,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
2015-01-23 10:10:24,528 INFO  [STDOUT] (main) 10:10:24,528 INFO  [DefaultSecurityFilterChain] Creating filter chain: Ant [pattern='/css/**'], []
2015-01-23 10:10:24,538 INFO  [STDOUT] (main) 10:10:24,538 INFO  [DefaultSecurityFilterChain] Creating filter chain: Ant [pattern='/images/**'], []
2015-01-23 10:10:24,538 INFO  [STDOUT] (main) 10:10:24,538 INFO  [DefaultSecurityFilterChain] Creating filter chain: Ant [pattern='/scripts/**'], []
2015-01-23 10:10:24,548 INFO  [STDOUT] (main) 10:10:24,548 INFO  [DefaultSecurityFilterChain] Creating filter chain: Ant [pattern='/sessiontimeout/**'], []
2015-01-23 10:10:24,558 INFO  [STDOUT] (main) 10:10:24,558 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@5afafba9, []
2015-01-23 10:10:24,568 INFO  [STDOUT] (main) 10:10:24,568 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@5d2b4707, []
2015-01-23 10:10:24,578 INFO  [STDOUT] (main) 10:10:24,578 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@65ba406d, []
2015-01-23 10:10:24,578 INFO  [STDOUT] (main) 10:10:24,578 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@4bb217b8, []
2015-01-23 10:10:24,588 INFO  [STDOUT] (main) 10:10:24,588 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@51f096bc, []
2015-01-23 10:10:24,588 INFO  [STDOUT] (main) 10:10:24,588 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@d90931f, []
2015-01-23 10:10:24,588 INFO  [STDOUT] (main) 10:10:24,588 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@28bef1b1, []
2015-01-23 10:10:24,598 INFO  [STDOUT] (main) 10:10:24,598 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@c5286cb, []
2015-01-23 10:10:24,608 INFO  [STDOUT] (main) 10:10:24,608 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@7faf30f3, []
2015-01-23 10:10:24,608 INFO  [STDOUT] (main) 10:10:24,608 INFO  [DefaultSecurityFilterChain] Creating filter chain: org.springframework.security.web.util.RegexRequestMatcher@417e3a86, []
2015-01-23 10:10:24,810 INFO  [STDOUT] (main) 10:10:24,810 INFO  [ChannelProcessingFilter] Validated configuration attributes
2015-01-23 10:10:24,950 INFO  [STDOUT] (main) 10:10:24,950 INFO  [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@71b625af: defining beans [mimeTypeMap,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,mainUserService,org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler#0,org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor#0,org.springframework.security.methodSecurityMetadataSourceAdvisor,org.springframework.aop.config.internalAutoProxyCreator,customUserDetailsService,springSecurityFilterChain,customFilter,customExceptionTranslationFilter,preauthAuthProvider,http403EntryPoint,org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.DefaultSecurityFilterChain#0,org.springframework.security.web.DefaultSecurityFilterChain#1,org.springframework.security.web.DefaultSecurityFilterChain#2,org.springframework.security.web.DefaultSecurityFilterChain#3,org.springframework.security.web.DefaultSecurityFilterChain#4,org.springframework.security.web.DefaultSecurityFilterChain#5,org.springframework.security.web.DefaultSecurityFilterChain#6,org.springframework.security.web.DefaultSecurityFilterChain#7,org.springframework.security.web.DefaultSecurityFilterChain#8,org.springframework.security.web.DefaultSecurityFilterChain#9,org.springframework.security.web.DefaultSecurityFilterChain#10,org.springframework.security.web.DefaultSecurityFilterChain#11,org.springframework.security.web.DefaultSecurityFilterChain#12,org.springframework.security.web.DefaultSecurityFilterChain#13,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.web.PortResolverImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.access.channel.ChannelDecisionManagerImpl#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#1,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#14,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
[ContextLoader] Context initialization failed   
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Cannot resolve reference to bean 'org.springframework.security.filterChains' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#14' while setting bean property 'sourceList' with key [14]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#14': Cannot resolve reference to bean 'customFilter' while setting constructor argument with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customFilter' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'preauthAuthProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'preauthAuthProvider' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Cannot create inner bean 'userDetailsServiceWrapper' of type [org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper] while setting bean property 'preAuthenticatedUserDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDetailsServiceWrapper' defined in ServletContext resource [/WEB-INF/applicationContext-security.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.mycompany.common.auth.CustomUserDetailsService' to required type 'org.springframework.security.core.userdetails.UserDetailsService' for property 'userDetailsService'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.mycompany.common.auth.CustomUserDetailsService] to required type [org.springframework.security.core.userdetails.UserDetailsService] for property 'userDetailsService': no matching editors or conversion strategy found
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:377)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4389)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:321)
        at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
        at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
        at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
        at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
        at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
        at $Proxy38.start(Unknown Source)
        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
        at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
        at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
        at org.jboss.system.ServiceController.start(ServiceController.java:460)
        at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
        at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
        at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractS

        at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:450)

我在WEB-INF / lib中拥有所有spring core和security jar。 applicationContext.xml和applicationContext-security.xml也处于WEB-INF级别。我不知道为什么我会收到这个错误。

这是我的安全上下文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:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
                        http://www.springframework.org/schema/context 
                        http://www.springframework.org/schema/context/spring-context-3.0.xsd 
                        http://www.springframework.org/schema/util 
                        http://www.springframework.org/schema/util/spring-util-3.0.xsd" >

    <global-method-security pre-post-annotations="enabled" />
    <context:annotation-config/>

<beans:bean id="customUserDetailsService" class="org.mycompany.common.auth.CustomUserDetailsService"/>
    <beans:bean id="springSecurityFilterChain" class="org.springframework.web.filter.DelegatingFilterProxy"/>

  <beans:bean id="customFilter" class="org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter">
    <beans:property name="principalRequestHeader" value="uid"/>
    <beans:property name="authenticationManager" ref="authenticationManager" />
    <beans:property name="continueFilterChainOnUnsuccessfulAuthentication" value="false"/>
  </beans:bean>

  <beans:bean id="customExceptionTranslationFilter" class="org.mycompany.common.filter.MyAppMainFilter"/>

  <beans:bean id="preauthAuthProvider" class="org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider">
    <beans:property name="preAuthenticatedUserDetailsService">
      <beans:bean id="userDetailsServiceWrapper"            class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">
        <beans:property name="userDetailsService" ref="customUserDetailsService"/>
      </beans:bean>
    </beans:property>

    </beans:bean>


    <beans:bean id="http403EntryPoint" class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint">
    </beans:bean>



     <http pattern="/css/**" security="none"/>
    <http pattern="/images/**" security="none"/>
    <http pattern="/scripts/**" security="none"/>
    <http pattern="/sessionTimeout/**" security="none"/>









    <authentication-manager alias="authenticationManager">
      <authentication-provider ref="preauthAuthProvider" />
    </authentication-manager>

</beans:beans>

0 个答案:

没有答案
相关问题