简体   繁体   中英

Erro on compile/run grails app 3.2.5 on Elementary OS

Well, I create grails projects with version 3.1.10 , 3.2.0 , 3.2.3 , 3.2.4 with success.

When I use 3.2.5 , 3.2.6 or 3.2.7 , I have errors like this:

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)

My environment:

$ 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)

I am using sdk do manager grails version:

$ sdk use grails 3.xx

When use 3.2.5 , 3.2.6 or 3.2.7 , problems.

Steps with all version reported:

$ sdk use grails 3.x.x
$ grails create-app g3xx
$ cd g3xx
$ grails compile

With 3.2.5 :

*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*

With 3.2.6 :

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

With 3.2.7 :

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)

Check your dependencies, something is incorrect about them and is causing the Servlet API and Spring JARs not to be on the compile classpath. Running gradle dependencies will help you identify the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM