无法通过调用'grails create-app PROJECTNAME'来创建grails项目

时间:2015-04-21 08:39:55

标签: macos grails gradle grails-3.0

我通过gvm安装了grails 3.0.1并尝试通过调用

创建一个新的grails项目
# grails create-app myproject
| Error Error occurred running Grails CLI: org.yaml.snakeyaml.Yaml.loadAs(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object; (Use --stacktrace to see the full trace)

完整的错误消息如下:

# grails --verbose --stacktrace create-app myproject 
| Error Error occurred running Grails CLI: org.yaml.snakeyaml.Yaml.loadAs(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;
java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.loadAs(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;
at org.grails.cli.profile.DefaultProfile$_initialize_closure5.doCall(DefaultProfile.groovy:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:292)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
at groovy.lang.Closure.call(Closure.java:423)
at groovy.lang.Closure.call(Closure.java:439)
at org.codehaus.groovy.runtime.IOGroovyMethods.withStream(IOGroovyMethods.java:1204)
at org.codehaus.groovy.runtime.ResourceGroovyMethods.withInputStream(ResourceGroovyMethods.java:1642)
at org.grails.cli.profile.DefaultProfile.initialize(DefaultProfile.groovy:206)
at org.grails.cli.profile.DefaultProfile.create(DefaultProfile.groovy:59)
at org.grails.cli.profile.git.GitProfileRepository.getProfile(GitProfileRepository.groovy:61)
at org.grails.cli.profile.commands.CreateAppCommand.handle(CreateAppCommand.groovy:70)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:173)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:99)
| Error Error occurred running Grails CLI: org.yaml.snakeyaml.Yaml.loadAs(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;

(grails 3.0.0也出现同样的错误。 使用java 1.8.0_45而不是1.8.0_31时,错误仍然存​​在。)

有什么想法吗?

---

修改

我在Windows机器上调用了grails create-app myproject并在我的Mac上复制了该文件夹。然后我跑

# grails compile --debug --stacktrace

FAILURE: Build failed with an exception.

* What went wrong:
Could not create an instance of type org.gradle.api.internal.project.DefaultProject_Decorated.
> com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List;

* 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: 5.814 secs
| Error Error initializing classpath: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List; (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoSuchMethodError: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List;
at org.gradle.model.internal.core.ModelPath.<init>(ModelPath.java:44)
at org.gradle.model.internal.core.ModelPath.path(ModelPath.java:93)
at org.gradle.model.internal.core.ModelReference.of(ModelReference.java:60)
at org.gradle.api.internal.project.AbstractProject.<init>(AbstractProject.java:178)
at org.gradle.api.internal.project.DefaultProject.<init>(DefaultProject.java:31)
at org.gradle.api.internal.project.DefaultProject_Decorated.<init>(Unknown Source)
at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:39)
at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
at org.gradle.api.internal.project.ProjectFactory.createProject(ProjectFactory.java:47)
at org.gradle.api.internal.project.ProjectFactory.createProject(ProjectFactory.java:29)
at org.gradle.initialization.InstantiatingBuildLoader.createProjects(InstantiatingBuildLoader.java:46)
at org.gradle.initialization.InstantiatingBuildLoader.load(InstantiatingBuildLoader.java:37)
at org.gradle.initialization.ProjectPropertySettingBuildLoader.load(ProjectPropertySettingBuildLoader.java:47)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:125)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:97)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.configure(InProcessBuildActionExecuter.java:84)
at org.gradle.tooling.internal.provider.ClientProvidedBuildAction.run(ClientProvidedBuildAction.java:43)
at org.gradle.tooling.internal.provider.ClientProvidedBuildAction.run(ClientProvidedBuildAction.java:31)
at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:119)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:48)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:71)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
| Error Error initializing classpath: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List;

---

我系统的一些有用信息:

# java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

# grails -version
| Grails Version: 3.0.1
| Groovy Version: 2.4.3
| JVM Version: 1.8.0_31

# uname -a
Darwin <anonymous>.edu 14.3.0 Darwin Kernel Version 14.3.0: Wed Apr  8 03:17:44 PDT 2015; root:xnu-2782.20.48~13/RELEASE_X86_64 x86_64

0 个答案:

没有答案