Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

MonitorFilter::WARNING: the monitor filter must be the first filter in the chain.

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};
    }
}
3 respostas

Ta dando algum erro na app? sendo sincero , nunca vi esse erro na vida.. caçando um pouco no google, parece ter algo a ver com a versao do tomcat e esse filtro de monitoramento ai... Eu atualizaria a versao para ver...

Vou tentar atualizar e dou um feedback! Obrigado

PS: Não há nenhum erro com a aplicação!

solução!

Pessoal, caso alguém tenha o mesmo Warning, basta desativar o Monitor HTTP do apache Tomcat.

Esse Warning se dá por conta de um conflito entre filtros do Spring Security e do Monitor HTTP =].

Ao que notei até o momento, ele apenas atrapalha no desenvolvimento, pois ao subir a aplicação em nosso servidor de testes o Warning não apareceu.

PS: utilizo o NetBeans, mas não o recomendo muito hahah.