【问题标题】:Grails 3.1 and spring-security-core:3.0.3Grails 3.1 和 spring-security-core:3.0.3
【发布时间】:2016-05-06 19:18:30
【问题描述】:

当我尝试使用时

grails s2-quickstart com.kanabang secUser secRole

它在控制台中显示以下内容。

Error |
Error occurred running Grails CLI: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
GStringTemplateScript1.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error

无法创建 bean。

我的依赖

dependencies {
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"

    compile "org.grails.plugins:hibernate"
    compile "org.grails.plugins:cache"
    compile "org.hibernate:hibernate-ehcache"
    compile "org.grails.plugins:scaffolding"

    compile 'org.grails.plugins:spring-security-core:3.0.3'
    runtime "org.grails.plugins:asset-pipeline"

    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"

    // Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
    testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'

    console "org.grails:grails-console"
}

是bug还是配置错误?

请注意:我使用的是 intellij 15

【问题讨论】:

  • 感谢 grails 缺少 org.springframework.beans.factory.annotation.Autowired 的库

标签: java spring grails intellij-idea spring-security


【解决方案1】:

经过一些测试。

我尝试使用 mingw64 构建应用程序。

域类创建成功。

在这样做之前。我需要在路径中添加 grails_home。

谢谢,这是关键。

【讨论】:

  • 您是否使用 sdkman 来管理 grails 安装? (sdkman.io)。它使切换安装变得容易。
猜你喜欢
  • 2011-04-22
  • 2017-11-09
  • 2019-05-09
  • 2017-06-20
  • 2012-11-04
  • 1970-01-01
  • 2011-09-12
  • 2016-03-23
  • 2012-09-29
相关资源
最近更新 更多