Grails文件resources.groovy被Spring工具套件忽略
最新版本的STS(例如3.7.3)不再支持Grails,因此我使用STS Gradle项目作为解决方案,以便使用“Spring Boot App”选项运行我的Grails应用程序。它工作得很好,但我面临以下问题: 问题: 当我通过运行为“Spring Boot App”的STS执行应用程序时,不知何故,resources.groovy文件下声明的所有bean都被忽略了。请注意,通过控制台“runapp”命令运行应用程序可以正常工作 例外情况:Grails文件resources.groovy被Spring工具套件忽略,grails,spring-tool-suite,Grails,Spring Tool Suite,最新版本的STS(例如3.7.3)不再支持Grails,因此我使用STS Gradle项目作为解决方案,以便使用“Spring Boot App”选项运行我的Grails应用程序。它工作得很好,但我面临以下问题: 问题: 当我通过运行为“Spring Boot App”的STS执行应用程序时,不知何故,resources.groovy文件下声明的所有bean都被忽略了。请注意,通过控制台“runapp”命令运行应用程序可以正常工作 例外情况: 原因:org.springframework.bea
原因:org.springframework.beans.factory.BeanCreationException:创建名为“facebookAuthRedirectFilter”的bean时出错:设置bean属性“authenticationFailureHandler”时无法解析对bean“redirectFailureHandlerExample”的引用;嵌套异常为org.springframework.beans.factory.NoSuchBean定义异常:未定义名为“redirectFailureHandlerExample”的bean
My resources.groovy文件
package spring
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
beans = {
redirectFailureHandlerFacebook(SimpleUrlAuthenticationFailureHandler) {
setDefaultFailureUrl('/login/auth')
}
}
STS:
版本:3.7.3.1发布
构建Id:201602250940
平台:EclipseMars.2(4.5.2)
Grails:
Grails版本:3.1.1
Groovy版本:2.4.5
JVM版本:1.7.0_75
这似乎是类路径问题,但我还没有找到解决方法 通过更新Groovy编译器设置解决了该问题。转到窗口->首选项->Groovy->编译器,请参见以下内容:
执行此操作将编译groovy,bean将在运行时可用。通过更新groovy编译器设置来解决此问题。转到窗口->首选项->Groovy->编译器,请参见以下内容: 执行此操作将编译groovy,bean将在运行时可用