【发布时间】:2016-03-09 14:11:21
【问题描述】:
最新版本的 STS(例如 3.7.3)不再支持 Grails,因此我使用 STS Gradle 项目作为解决方法,以便使用“Spring Boot App”选项运行我的 Grails 应用程序。它工作得很好,但我遇到了以下问题:
问题:
当我通过作为“Spring Boot App”运行的 STS 执行应用程序时,不知何故,在 resources.groovy 文件下声明的所有 bean 都被忽略了。请注意,通过控制台“run-app”命令运行应用程序可以正常工作。
例外:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'facebookAuthRedirectFilter': Cannot resolve reference to bean 'redirectFailureHandlerExample' while setting bean property 'authenticationFailureHandler'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'redirectFailureHandlerExample' is defined
我的 resources.groovy 文件
package spring
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
beans = {
redirectFailureHandlerFacebook(SimpleUrlAuthenticationFailureHandler) {
setDefaultFailureUrl('/login/auth')
}
}
STS:
版本:3.7.3.RELEASE 内部版本号:201602250940 平台:Eclipse Mars.2 (4.5.2)
Grails:
Grails 版本:3.1.1 Groovy 版本:2.4.5 JVM版本:1.7.0_75
这似乎是 classpath 问题,但我还没有找到解决方法。
【问题讨论】: