내장 된 h2 데이터베이스와 함께 Spring Boot 1.2.0을 사용하고 있습니다. 데이터베이스는 클래스 경로의 schema.sql 파일을 사용하여 초기화됩니다. @EnableGlobalMethodSecurity 주석을 WebSecurityConfiguration 클래스에 추가 할 때까지 제대로 작동했습니다.DataSourceInitializer : ApplicationEventMulticaster가 초기화되지 않았습니다.
java.lang.IllegalStateException : ApplicationEventMulticaster와는 예외가 문제가 될 수 무엇 DataSourceInitializer.runSchemaScripts
에서 발생합니다 초기화되지?
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
@EnableGlobalMethodSecurity(securedEnabled = true)
@Configuration
class WebSecurityConfiguration extends GlobalAuthenticationConfigurerAdapter {
@Autowired
DataSource dataSource;
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication().dataSource(dataSource);
}
}
[# 1711] (https://github.com/spring-projects/spring-boot/issues/1711)와 유사합니다. 'WebSecurityConfiguration'은 당신의 주요'Application'과 다른 클래스입니다, 맞습니까? –
'WebSecurityConfiguration'이 다른 클래스에 있습니다. 나는 또한 그것을 메인 어플리케이션의 내부 클래스로 만들려고 노력했다. 그러나 나는 같은 예외를 얻고있다. – leon01