ApplicationContextSecurity.xml mauvais DOCTYPE
Bonjour,
Je suis en train d'installere Spring Security et je rencontre un problème dans mon applicationContextSecurity.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
<http auto-config="true">
<intercept-url pattern="/**" access="ROLE_USER" />
</http>
<authentication-provider>
<user-service>
<user name="toto000" password="toto000" authorities="ROLE_USER, ROLE_ADMIN" />
<user name="toto001" password="toto001" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</beans:beans> |
Lorsque je lance mon projet sous Eclipse, j'ai une exception :
Code:
1 2 3 4
|
GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/applicationContextSecurity.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans:beans", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans:beans", must match DOCTYPE root "null". |
Donc je me dis que j'ai peut être oublié de mettre la ligne :
Code:
<!DOCTYPE beans SYSTEM "http://www.springframework.org/dtd/spring-beans.dtd">
Mais lorsque je relance , j'ai ca :
Code:
1 2
|
Document root element "beans:beans", must match DOCTYPE root "beans". |
J'utilise Spring v2 avec spring-security-2.0.5
J'ai bien mis mes xml dans web.xml :
Code:
1 2 3 4 5
| <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml /WEB-INF/applicationContextSecurity.xml
</param-value>
</context-param> |
Je ne vois pas mon problème...