首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编译/运行grails应用程序3.2.5在初级操作系统上的错误

编译/运行grails应用程序3.2.5在初级操作系统上的错误
EN

Stack Overflow用户
提问于 2017-03-22 00:56:16
回答 1查看 392关注 0票数 0

好吧,我用3.1.103.2.03.2.33.2.4成功地创建了grails项目。

当我使用3.2.53.2.63.2.7时,会出现如下错误:

代码语言:javascript
复制
Download https://repo.grails.org/grails/core/org/grails/grails-test/3.2.6/grails-test-3.2.6.jar
| Error Failed to compile CreateScaffoldController.groovy: startup failed:
CreateScaffoldController.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error
 (Use --stacktrace to see the full trace)
| Error Command [compile] error: null (Use --stacktrace to see the full trace)

我的环境:

代码语言:javascript
复制
$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

我使用的是sdk do manager grails版本:

$ sdk使用grails3.x.x

当使用3.2.53.2.63.2.7时,会出现问题。

所有版本报告的步骤:

代码语言:javascript
复制
$ sdk use grails 3.x.x
$ grails create-app g3xx
$ cd g3xx
$ grails compile

使用3.2.5

代码语言:javascript
复制
*g325 $ grails compile --stacktrace
| Error Failed to compile CreateScaffoldController.groovy: startup failed:
CreateScaffoldController.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error
 (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
CreateScaffoldController.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error

    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.readCommandFile(GroovyScriptCommandFactory.groovy:48)
    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.readCommandFile(GroovyScriptCommandFactory.groovy)
    at org.grails.cli.profile.commands.factory.ResourceResolvingCommandFactory.findCommands(ResourceResolvingCommandFactory.groovy:44)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy:86)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy)
    at org.grails.cli.profile.AbstractProfile.getCommands(AbstractProfile.groovy:438)
    at org.grails.cli.profile.repository.AbstractJarProfileRepository$JarProfile.getCommands(AbstractJarProfileRepository.groovy:130)
    at org.grails.cli.profile.AbstractProfile.handleCommand(AbstractProfile.groovy:468)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:377)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:350)
    at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:271)
    at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Failed to compile CreateScaffoldController.groovy: startup failed:
CreateScaffoldController.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error
| Error Command [compile] error: null (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NullPointerException
    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.createCommand(GroovyScriptCommandFactory.groovy:83)
    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.createCommand(GroovyScriptCommandFactory.groovy)
    at org.grails.cli.profile.commands.factory.ResourceResolvingCommandFactory.findCommands(ResourceResolvingCommandFactory.groovy:46)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy:86)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy)
    at org.grails.cli.profile.AbstractProfile.getCommands(AbstractProfile.groovy:438)
    at org.grails.cli.profile.repository.AbstractJarProfileRepository$JarProfile.getCommands(AbstractJarProfileRepository.groovy:130)
    at org.grails.cli.profile.AbstractProfile.handleCommand(AbstractProfile.groovy:468)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:377)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:350)
    at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:271)
    at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Command [compile] error: null*

使用3.2.6

代码语言:javascript
复制
g326 $ grails compile --stacktrace
| Error Failed to compile CreateScaffoldController.groovy: startup failed:
CreateScaffoldController.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error
 (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
CreateScaffoldController.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error

    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.readCommandFile(GroovyScriptCommandFactory.groovy:48)
    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.readCommandFile(GroovyScriptCommandFactory.groovy)
    at org.grails.cli.profile.commands.factory.ResourceResolvingCommandFactory.findCommands(ResourceResolvingCommandFactory.groovy:44)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy:86)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy)
    at org.grails.cli.profile.AbstractProfile.getCommands(AbstractProfile.groovy:438)
    at org.grails.cli.profile.repository.AbstractJarProfileRepository$JarProfile.getCommands(AbstractJarProfileRepository.groovy:130)
    at org.grails.cli.profile.AbstractProfile.handleCommand(AbstractProfile.groovy:468)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:377)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:350)
    at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:271)
    at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Failed to compile CreateScaffoldController.groovy: startup failed:
CreateScaffoldController.groovy: -1: unable to resolve class org.springframework.beans.factory.annotation.Autowired
 @ line -1, column -1.
1 error
| Error Command [compile] error: null (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NullPointerException
    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.createCommand(GroovyScriptCommandFactory.groovy:83)
    at org.grails.cli.profile.commands.factory.GroovyScriptCommandFactory.createCommand(GroovyScriptCommandFactory.groovy)
    at org.grails.cli.profile.commands.factory.ResourceResolvingCommandFactory.findCommands(ResourceResolvingCommandFactory.groovy:46)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy:86)
    at org.grails.cli.profile.commands.CommandRegistry.findCommands(CommandRegistry.groovy)
    at org.grails.cli.profile.AbstractProfile.getCommands(AbstractProfile.groovy:438)
    at org.grails.cli.profile.repository.AbstractJarProfileRepository$JarProfile.getCommands(AbstractJarProfileRepository.groovy:130)
    at org.grails.cli.profile.AbstractProfile.handleCommand(AbstractProfile.groovy:468)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:377)
    at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:350)
    at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:271)
    at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Command [compile] error: null

使用3.2.7

代码语言:javascript
复制
Unzipping /home/adriano/.gradle/wrapper/dists/gradle-3.4.1-bin/71zneekfcxxu7l9p7nr2sc65s/gradle-3.4.1-bin.zip to /home/adriano/.gradle/wrapper/dists/gradle-3.4.1-bin/71zneekfcxxu7l9p7nr2sc65s
Set executable permissions for: /home/adriano/.gradle/wrapper/dists/gradle-3.4.1-bin/71zneekfcxxu7l9p7nr2sc65s/gradle-3.4.1/bin/gradle

CONFIGURE SUCCESSFUL

Total time: 5 mins 24.911 secs
:compileJava NO-SOURCE
:compileGroovy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> javax/servlet/http/HttpServletRequest

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.131 secs
| Error Gradle build terminated with error: javax.servlet.http.HttpServletRequest (Use --stacktrace to see the full trace)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-22 07:18:48

检查您的依赖项,它们有些不正确,导致Servlet和Spring不在编译类路径上。运行gradle dependencies将帮助您识别问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42940872

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档