Após implantar o spring security, essa mensagem começou a aparecer no log! Obs: tudo está funcionando corretamente.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.
O que poderia ser isso?
Seguem as classe de configuração:
SecurityConfiguration.java:
package br.com.gbd.sru.config;
import br.com.gbd.sru.daos.UsuarioDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
/*
Autor(es): José Carlos de Freitas
Data: 31/03/2017 às 08:37:21
Arquivo: SecurityConfiguration.java
*/
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private UsuarioDAO usuarioDAO;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/resources/**").permitAll()
.antMatchers("/admin/**").hasRole("ADMIN")
.antMatchers("/**").permitAll()
.anyRequest().authenticated()
.and().formLogin().loginPage("/login").permitAll()
.and().logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout"));
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(usuarioDAO);
// .passwordEncoder(new BCryptPasswordEncoder());
}
}
SpringSecurityFilterCOnfiguration.java:
package br.com.gbd.sru.config;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
/*
Autor(es): José Carlos de Freitas
Data: 31/03/2017 às 08:35:00
Arquivo: SpringSecurityFilterConfiguration.java
*/
public class SpringSecurityFilterConfiguration extends AbstractSecurityWebApplicationInitializer{
}
ServletSpringMvc.java:
package br.com.gbd.sru.config;
import javax.servlet.Filter;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
/*
Autor(es): José Carlos de Freitas
Data: 05/03/2017 às 10:31:24
Arquivo: ServletSpringMvc
*/
public class ServletSpringMvc extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[]{SecurityConfiguration.class, AppWebConfiguration.class, JPAConfiguration.class};
}
@Override
protected Class<?>[] getServletConfigClasses() {
return null;
}
@Override
protected String[] getServletMappings() {
return new String[]{"/"};
}
@Override
protected Filter[] getServletFilters() {
CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter();
encodingFilter.setEncoding("UTF-8");
return new Filter[]{encodingFilter};
}
}