java - A universal match pattern ('/**') is defined... error when trying to add spring security to project -



java - A universal match pattern ('/**') is defined... error when trying to add spring security to project -

i'm trying add together spring security project , i've tried utilize solutions found on internet, nil worked. have ideas?? stack trace:

caused by: java.lang.illegalargumentexception: universal match pattern ('/**') defined before other patterns in filter chain, causing them ignored. please check ordering in <security:http> namespace or filterchainproxy bean configuration @ org.springframework.security.config.http.defaultfilterchainvalidator.checkpathorder(defaultfilterchainvalidator.java:51) @ org.springframework.security.config.http.defaultfilterchainvalidator.validate(defaultfilterchainvalidator.java:40) ...

web.xml

<?xml version="1.0" encoding="iso-8859-1" ?> <web-app ..> <display-name>archetype created web application</display-name> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <context-param> <param-name>contextconfiglocation</param-name> <param-value> /web-inf/context.xml, /web-inf/spring-security.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> <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> </web-app>

spring-security.xml:

<beans:beans ...> <http auto-config="true" use-expressions="true"> <intercept-url pattern="/admin**" access="hasrole('role_admin')" /> <access-denied-handler error-page="/403" /> <form-login login-page="/user/login" default-target-url="/index" authentication-failure-url="/index" username-parameter="username" password-parameter="password" /> <logout logout-success-url="/index" /> </http> <authentication-manager> <authentication-provider> <jdbc-user-service data-source-ref="datasource" users-by-username-query= "select username,password users username=?" authorities-by-username-query= "select username, role users bring together user_roles using(id_user_roles) username =?" /> </authentication-provider> </authentication-manager> </beans:beans>

shall add together attach other .xml files project?

java spring-security

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -