2检测到Spring WebApplicationInitializers

时间:2016-08-09 01:59:20

标签: java spring-security tomcat7

我有一个带执行器的弹簧启动应用程序。当我将应用程序部署为Embeded Web部署时,/ health页面可以正常工作。但是如果我创建一个war文件并将其部署在外部Tomcat中,我会收到提示以访问健康页面的令牌。这是我的SecurityConfig.java

protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable();
    http.authorizeRequests()
        .antMatchers("/services/courses/**").authenticated();
        .antMatchers("/services/health").permitAll()
        .antMatchers("/services/auth/token").permitAll();
    Filter tokenAuthenticationFilter = (Filter) this.tokenAuthenticationFilter;
    http.addFilterBefore(tokenAuthenticationFilter,  UsernamePasswordAuthenticationFilter.class);
}

在查看tomcat日志文件时,我在localhost.2016-08-08.log中看到以下日志

08-Aug-2016 11:58:40.186 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log 2 Spring WebApplicationInitializers detected on classpath
08-Aug-2016 11:58:44.928 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext
08-Aug-2016 11:59:02.412 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()

我已经添加了logging.level.org.springframework.web = DEBUG和-verbose:class来查看类加载信息。但到目前为止还没有取得多大进展。

知道还有什么我应该尝试的吗?

0 个答案:

没有答案