A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Frameworks
»
Spring
Author
problem with spring security
misha nesterenko
Greenhorn
Joined: Feb 05, 2011
Posts: 28
posted
Feb 18, 2011 09:57:06
0
I am trying to get spring security working, but still no luck
I have web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext-security.xml </param-value> </context-param> <servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>
and applicationContext-security.xml
<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> <http auto-config="true"> <intercept-url pattern="/register.html" access="IS_AUTHENTICATED_ANONYMOUSLY" /> <intercept-url pattern="/*" access="ROLE_USER, ROLE_ADMIN" /> <logout logout-url="/logout"/> </http> <beans:bean id="myUserDetailsService" class="labas.spring.service.UserDetailsImp"/> <authentication-manager> <authentication-provider user-service-ref='myUserDetailsService'/> </authentication-manager> </beans:beans>
when I run it, I get
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered? org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:159)
Prasad Krishnegowda
Ranch Hand
Joined: Apr 25, 2010
Posts: 503
I like...
posted
Feb 20, 2011 02:19:09
1
where is the contextloaderlistener defined..? Add this to web.xml
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
Regards, Prasad
SCJP 5 (93%)
Lee Button
Greenhorn
Joined: Jul 02, 2009
Posts: 1
posted
Feb 28, 2011 18:40:26
0
Have all the spring jars been deployed to the server in the WEB-INF/lib folder?
misha nesterenko
Greenhorn
Joined: Feb 05, 2011
Posts: 28
posted
Feb 28, 2011 23:52:37
0
Lee Button wrote:
Have all the spring jars been deployed to the server in the WEB-INF/lib folder?
Yes
I agree. Here's the link:
http://aspose.com/file-tools
subject: problem with spring security
Similar Threads
[Spring Security] No bean named 'springSecurityFilterChain' is defined
spring security 3.1 login not working.
RichFaces + Spring Security -- Problem Load RichFaces
RequestDispatcher null - cant find /j_spring_security_check
Problem in Spring security redirection
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter