【发布时间】:2017-08-24 04:49:54
【问题描述】:
我正在尝试使用最新的 Spring boot 版本 1.5.2.RELEASE 运行一个简单的 oauth2 应用程序。
我按照spring-boot-oauth2 的所有步骤操作,直到他们告诉您“发生了什么”,但在配置 application.yml 后,运行应用程序不起作用并出现以下错误 -
WARN 27759 [main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.opentable.DemoApplication]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2SsoDefaultConfiguration due to org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
ERROR 27759 [main] o.s.b.f.s.DefaultListableBeanFactory: Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@3b07a0d6: startup date [Thu Mar 30 15:06:55 IST 2017]; root of context hierarchy
是否需要显式创建配置类?
【问题讨论】:
标签: spring spring-mvc spring-boot oauth-2.0