Hallo,
ich bin gerade dabei, eine ganz einfache Web- Applikation mit Spring Security zu versehen. Ich bekomme aber leider einen Fehler der mir nicht klar ist und bei dem ich nicht weiterkomm,
Vielleicht kann sich das mal jemand ansehen, Ich bekomme beim ausführen der Applikation folgenden Fehler,
Besten Dank,
lg
[XML]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:util="http://www.springframework.org/schema/util"
xmlns="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Index of /schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
Index of /schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
Index of /schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
Index of /schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
<bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
<property name="providers">
<list>
<ref bean="authenticationProvider" />
</list>
</property>
</bean>
<bean id="authenticationProvider" class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
<property name="userDetailsService" ref="authenticationDao" />
</bean>
<bean id="authenticationDao" class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
<property name="userMap">
<value>
user1=password1,ROLE_ADMIN
user2=password2,ROLE_USER
user3=password3,ROLE_ADVANCEDUSER
user4=password4,ROLE_HASPAIED
</value>
</property>
</bean>
<bean id="fooFilter" class="at.eventtiming.FooFilter"> <!-- vom in web.xml deklarierten filter Foo wird hier her- delegiert -->
<property name="myString" value="Das ist der String aus dem Config- File springSecurity" /> <!-- Mit Spring ist es möglich einem Filter eine Bean zu injizieren, was normal mit einem Filter nicht möglich ist -->
</bean>
<bean id="filterChainProxy" class="org.springframework.security.util.FilterChainProxy">
<property name="filterInvocationDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/**=httpSessionIntegrationFilter,
authenticationProcessingFilter,
exceptionTranslationFilter,
filterSecurityInterceptor
</value>
</property>
</bean>
<!-- Filter 1 -->
<bean id="httpSessionIntegrationFilter"
class="org.springframework.security.context.HttpSessionContextIntegrationFilter" />
<!-- Filter 2 -->
<bean id="authenticationProcessingFilter" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter">
<property name="filterProcessesUrl" value="/j_acegi_security_check" />
<property name="authenticationFailureUrl" value="/login.htm?login_error=1" />
<property name="defaultTargetUrl" value="/" />
<property name="authenticationManager" ref="authenticationManager" />
</bean>
<bean id="authenticationEntryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
<property name="loginFormUrl" value="/login.html" />
<property name="forceHttps" value="true" />
</bean>
<!-- Filter 3 -->
<bean id="exceptionTranslationFilter" class="org.springframework.security.ui.ExceptionTranslationFilter">
<property name="authenticationEntryPoint" ref="authenticationEntryPoint" />
<property name="accessDeniedHandler" ref="accessDenieHandler" />
</bean>
<bean id="accessDenieHandler" class="org.springframework.security.ui.AccessDeniedHandlerImpl">
<property name="errorPage" value="/error.htm" />
</bean>
<!-- Filter 4 -->
<bean id="filterSecurityInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
<property name="authenticationManager" ref="authenticationManager" />
<property name="accessDecisionManager" ref="accessDecisionManager" />
<property name="objectDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/editProfile.htm=ROLE_ADMIN
</value>
</property>
</bean>
</beans>
[/XML]
ich bin gerade dabei, eine ganz einfache Web- Applikation mit Spring Security zu versehen. Ich bekomme aber leider einen Fehler der mir nicht klar ist und bei dem ich nicht weiterkomm,
Vielleicht kann sich das mal jemand ansehen, Ich bekomme beim ausführen der Applikation folgenden Fehler,
Besten Dank,
lg
Code:
SCHWERWIEGEND: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'filterChainProxy' defined in ServletContext resource [/WEB-INF/springSecurity.xml]: Initialization of
bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to
convert property value of type [java.lang.String] to required type
[org.springframework.security.intercept.web.FilterInvocationDefinitionSource] for property
'filterInvocationDefinitionSource'; nested exception is java.lang.IllegalArgumentException: You must
provide a configuration attribute
[XML]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:util="http://www.springframework.org/schema/util"
xmlns="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Index of /schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
Index of /schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
Index of /schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
Index of /schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
<bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
<property name="providers">
<list>
<ref bean="authenticationProvider" />
</list>
</property>
</bean>
<bean id="authenticationProvider" class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
<property name="userDetailsService" ref="authenticationDao" />
</bean>
<bean id="authenticationDao" class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
<property name="userMap">
<value>
user1=password1,ROLE_ADMIN
user2=password2,ROLE_USER
user3=password3,ROLE_ADVANCEDUSER
user4=password4,ROLE_HASPAIED
</value>
</property>
</bean>
<bean id="fooFilter" class="at.eventtiming.FooFilter"> <!-- vom in web.xml deklarierten filter Foo wird hier her- delegiert -->
<property name="myString" value="Das ist der String aus dem Config- File springSecurity" /> <!-- Mit Spring ist es möglich einem Filter eine Bean zu injizieren, was normal mit einem Filter nicht möglich ist -->
</bean>
<bean id="filterChainProxy" class="org.springframework.security.util.FilterChainProxy">
<property name="filterInvocationDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/**=httpSessionIntegrationFilter,
authenticationProcessingFilter,
exceptionTranslationFilter,
filterSecurityInterceptor
</value>
</property>
</bean>
<!-- Filter 1 -->
<bean id="httpSessionIntegrationFilter"
class="org.springframework.security.context.HttpSessionContextIntegrationFilter" />
<!-- Filter 2 -->
<bean id="authenticationProcessingFilter" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter">
<property name="filterProcessesUrl" value="/j_acegi_security_check" />
<property name="authenticationFailureUrl" value="/login.htm?login_error=1" />
<property name="defaultTargetUrl" value="/" />
<property name="authenticationManager" ref="authenticationManager" />
</bean>
<bean id="authenticationEntryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint">
<property name="loginFormUrl" value="/login.html" />
<property name="forceHttps" value="true" />
</bean>
<!-- Filter 3 -->
<bean id="exceptionTranslationFilter" class="org.springframework.security.ui.ExceptionTranslationFilter">
<property name="authenticationEntryPoint" ref="authenticationEntryPoint" />
<property name="accessDeniedHandler" ref="accessDenieHandler" />
</bean>
<bean id="accessDenieHandler" class="org.springframework.security.ui.AccessDeniedHandlerImpl">
<property name="errorPage" value="/error.htm" />
</bean>
<!-- Filter 4 -->
<bean id="filterSecurityInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor">
<property name="authenticationManager" ref="authenticationManager" />
<property name="accessDecisionManager" ref="accessDecisionManager" />
<property name="objectDefinitionSource">
<value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/editProfile.htm=ROLE_ADMIN
</value>
</property>
</bean>
</beans>
[/XML]