grails - 执行创建应用程序时出现Grails错误

标签 grails

我正在使用jdk1.6和grails 1.3.4。我已经按照grails.org网站中的说明设置了JAVA_HOME,GRAILS_HOME和PATH变量。当我执行create-app命令时,出现以下错误:

C:\grails\grails-1.3.4>grails create-app C:\Users\Documents\Grails\helloworld Welcome to Grails 1.3.4 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: C:\grails\grails-1.3.4


Base Directory: C:\grails\grails-1.3.4
Resolving dependencies...
Dependencies resolved in 2102ms.
Running script C:\grails\grails-1.3.4\scripts\CreateApp_.groovy
Environment set to development
Error executing script CreateApp: java.lang.StringIndexOutOfBoundsException: Str
ing index out of range: 1
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
 1
        at java.lang.String.substring(String.java:1934)
        at grails.util.GrailsNameUtils.getClassNameRepresentation(GrailsNameUtil
s.java:82)
        at grails.util.GrailsNameUtils$getClassNameRepresentation.call(Unknown S
ource)
        at _GrailsCreateProject_groovy$_run_closure4.doCall(_GrailsCreateProject
_groovy:135)
        at _GrailsCreateProject_groovy$_run_closure1.doCall(_GrailsCreateProject
_groovy:36)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        ... 10 more
--- Nested Exception ---
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
        at java.lang.String.substring(String.java:1934)
        at grails.util.GrailsNameUtils.getClassNameRepresentation(GrailsNameUtil
s.java:82)
        at grails.util.GrailsNameUtils$getClassNameRepresentation.call(Unknown S
ource)
        at _GrailsCreateProject_groovy$_run_closure4.doCall(_GrailsCreateProject
_groovy:135)
        at _GrailsCreateProject_groovy$_run_closure1.doCall(_GrailsCreateProject
_groovy:36)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at gant.Gant.executeTargets(Gant.groovy:589)
Error executing script CreateApp: java.lang.StringIndexOutOfBoundsException: Str
ing index out of range: 1

有一个StringIndexOutOfBoundsException。谁能帮我解决这个问题?

谢谢

最佳答案

create-app: The starting point for Grails. This command creates a Grails application and requires the user to specify the application name. A subdirectory within the directory the command was executed from is then created based on the entered application name.



执行此命令的正确方法:
  • 使用命令提示符
  • 浏览到您的工作区目录
  • 输入“grails create-app helloworld
  • 将创建一个子目录“helloworld”作为您的工作区目录
  • 关于grails - 执行创建应用程序时出现Grails错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3619391/

    相关文章:

    grails - 如何在 grails 中使用 XML 用户文件实现身份验证?

    session - 如何模拟 RESTful 服务(Grails、Shiro)的 session cookie?

    mysql - 如何将 Grails 3.0 连接到我本地的 Mysql 数据库

    maven-2 - 带有 'mvn clean install' 的 Maven Grails 构建不起作用

    mysql - Grails 或 Hibernate 未创建丢失的表

    tomcat - Grails 3 App 在 tomcat 7 中显示 404 而不是主页

    web-services - Grails 异常 : Mapping qname not fond for the package: grails. 验证

    javascript - Grails在JavaScript中调用application.config值

    grails:相当于 php 的 $_POST 和 $_GET 的是什么

    twitter-bootstrap - GRAILS 3.1.0 不显示 Bootstrap 字形