2017-01-29 24 views

回答

0

沒有兩個進程可以在同一個端口上運行。所以,你需要更新其中的一個。最好嘗試更改tomcat端口號。

另外,嘗試登錄使用tomcat憑據,這可能是你的tomcat應用程序受到保護。請參閱tomcat-users.xml。

0

我在POM.xml中添加了SpringSecurity,並且在添加Spring Boot時會自動預先配置一些東西 - 增加了一些安全性。

添加該配置類,它工作正常。

@Configuration 

公共類SecurityConfiguration延伸WebSecurityConfigurerAdapter {

@Override 
protected void configure(HttpSecurity httpSecurity) throws Exception { 
    httpSecurity 
      .authorizeRequests() 
      .antMatchers("/") 
      .permitAll(); 

    // disabling csrf tokens and x-frame-options to be able to run h2 console (localhost:8080/console) 
    httpSecurity.csrf().disable(); 
    httpSecurity.headers().frameOptions().disable(); 
} 

}

相關問題