Hi, I've just got the book I order (Packt's Spring Security 3) and can't wai to test what I'm learning.
I did the basic example the book ilustrate on chapter 2, but now I want to customize my login page. Even though it looks simple (just create a login.jsp page and configure it using <form-login>) it keeps sending a really weird error:
I really don't know what it is about, but here's the applicationContext-security.xml I'm using:Code:Jul 14, 2011 3:59:55 PM org.springframework.web.context.ContextLoader initWebApplicationContext SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Invocation of init method failed; nested exception is java.lang.IllegalStateException: MessageSource not initialized - call 'refresh' before accessing messages via the context: Root WebApplicationContext: startup date [Thu Jul 14 15:59:54 BRT 2011]; root of context hierarchy
Thanks anyway.Code:<?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" 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"> <debug /> <http auto-config="true"> <form-login login-page="/login.jsp" authentication-failure-url="/login.jsp?error=invalido"/> <intercept-url pattern="/admin/*" access="ROLE_ADMIN" /> <intercept-url pattern="/*" access="ROLE_USER" /> </http> <authentication-manager> <authentication-provider> <user-service> <user name="admin" password="admin" authorities="ROLE_USER,ROLE_ADMIN" /> <user name="teste" password="teste" authorities="ROLE_USER" /> </user-service> </authentication-provider> </authentication-manager> </beans:beans>


Reply With Quote
