я получаю это исключение:Невозможно применить DaoAuthenticationConfigurer к уже построенный объект
[WARN] org.springframework.web.context.support.GenericWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountResource': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private io.ilopezluna.japanathome.service.UserService io.ilopezluna.japanathome.web.rest.AccountResource.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.crypto.password.PasswordEncoder io.ilopezluna.japanathome.service.UserService.passwordEncoder; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalStateException: Cannot apply org.springframework.security.config.annotation.aut[email protected]54aa5730 to already built object
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:293) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1186) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
Вы можете видеть больше на https://travis-ci.org/ilopezluna/japan-at-home/builds/37866955
Это исключение во время моего исполнения тестов. Но я не могу воспроизвести его на своем локальном хосте, я всегда получаю успех сборки: S
Упс, извините, обновлено! – ilopezluna
Сохраняется ли какая-либо конфигурация как статическое свойство? Можем ли мы увидеть 'SecurityConfiguration.configureGlobal'? Существует некоторая магия (http://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/testing.html#testcontext-ctx-management) за управление контекстом Spring в модульные тесты, чтобы они могли быть сломаны. –
уверен! здесь вы можете увидеть упомянутый метод: https://github.com/ilopezluna/japan-at-home/blob/master/src/main/java/io/ilopezluna/japanathome/config/SecurityConfiguration.java – ilopezluna