【问题标题】:Grails Plugin Uploadr doesn't runGrails 插件上传器不运行
【发布时间】:2014-07-18 19:07:52
【问题描述】:

我正在尝试使用上传器,但我无法使用它...即使 Uploadr-demo 也无法运行。

所以,这是我迄今为止尝试过的:

使用 Grails 2.4.2 并在现有项目中添加插件: 运行项目时出现此错误:

| Error 2014-07-16 16:00:54,667 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/jquery.tipTip.minified.js
| Error 2014-07-16 16:00:54,697 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/tipTip.css
| Error 2014-07-16 16:00:54,727 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/jquery.uploadr.js
| Error 2014-07-16 16:00:54,754 [localhost-startStop-1] ERROR resource.ResourceMeta  - Resource not found: /assets/jquery.uploadr.css

但是服务器启动了,但是当我尝试使用上传器打开页面时,我收到了这个错误:

Error 500: Internal Server Error
[...]
Class: java.lang.IllegalArgumentException
Message: Module [tipTip] depends on resource [/assets/jquery.tipTip.minified.js] but the file cannot be found

我试图打开的页面只是为了调用上传者演示:

 <head>
    <g:javascript library='jquery' />
    <r:require modules="uploadr"/>
    <r:layoutResources/>
</head>
<body>
    <uploadr:demo/>
    <r:layoutResources/>
</body>

构建配置:

    plugins {
    // plugins for the build system only
    build ":tomcat:7.0.54"

    // plugins for the compile step
    compile ":scaffolding:2.1.2"
    compile ':cache:1.1.7'
    compile ":asset-pipeline:1.8.11"

    //uploadr
    runtime ":resources:latest.integration"
    compile ":modernizr:latest.integration"
    compile ":uploadr:latest.integration"
    compile ":quartz:latest.integration" //1.0.1"

    // plugins needed at runtime but not for compilation
    runtime ":hibernate4:4.3.5.4" // or ":hibernate:3.6.10.16"
    runtime ":database-migration:1.4.0"
    runtime ":jquery:1.11.1"
}

由于它不起作用,我尝试从 github 下载 Uploadr-demo。 首先,我无法导入(我使用的是 Spring Tool Suite v.:3.5.1.RELEASE),因为演示是针对 grails 2.3.3 的。好吧,我得到了 grails 2.3.3,但它又没用。这次出现新错误:

Loading Grails 2.3.3
|Environment set to development
........
|Compiling 10 source files
..
|Compiling 154 source files
.Error 
|
Compilation error: startup failed:
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/uploadr-0.8.2/grails-app/controllers/hungry/wombat/UploadController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'hungry.wombat.UploadController'.
 @ line -1, column -1.
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/uploadr-0.8.2/grails-app/controllers/hungry/wombat/UploadController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'hungry.wombat.UploadController'.
 @ line -1, column -1.
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
 @ line -1, column -1.
 /home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
 @ line -1, column -1.
 4 errors

我也尝试使用 grails 2.3.3 创建一个新项目,但它甚至无法编译:

Command terminated with an exception: java.lang.Exception (see details for partial output)
Command: GrailsCommand(P/grails-uploadr> compile --non-interactive --refresh-dependencies)
---- System.out ----
Loading Grails 2.3.3
.
|Environment set to development
..........
|Compiling 79 source files
.Error 
|
Compilation error: startup failed:
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
 @ line -1, column -1.
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
 @ line -1, column -1.
2 errors

当我尝试使用 grails 2.3.3 创建一个新项目时,我首先将 $GRAILS_HOME 更改为指向 2.3.3,然后从已更新路径的终端调用 spring

好吧,我尝试了所有我能想到或在 Google 上找到的东西……有什么想法吗?

【问题讨论】:

  • 我想使用了 JDK 8,它只支持 Grails 2.4 及更高版本。因此,在您回退到 JDK 7 之前,您第二次尝试使用 Grails 2.3.3 将无法正常工作。
  • @dmahapatro,确实我使用的是 JDK 8。我试图回退到 JDK 7(Oracle jdk1.7.0_65),但仍然是同样的错误......

标签: grails grails-plugin


【解决方案1】:

我设法解决了问题,它正在运行,但仍然有错误... 我安装了 Grails 2.3.3 和 Oracle jdk1.7.0_65。使用两者我可以创建一个上传器工作的新项目,我也可以运行上传器演示,但两者都出现以下错误:

Groovy: compiler mismatch Project level is: 2.1 Workspace level is 2.3
Groovy compiler level expected by the project does not match workspace compiler level. 
Go to Project properties -> Groovy compiler to set the Groovy compiler level for this project   uploadr-Grails2.3.3-JDK7        uploadr-Grails2.3.3-JDK7    Groovy compiler mismatch problem


The resource is a duplicate of .link_to_grails_plugins/hibernate-3.6.10.4/grails-app/i18n/messages.properties and was not copied to the output folder   messages.properties /uploadr-Grails2.3.3-JDK7/.link_to_grails_plugins/resources-1.2.1/grails-app/i18n   Unknown Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'br.eti.andersonq.UploadrController'.    UploadrController.groovy    /uploadr-Grails2.3.3-JDK7/grails-app/controllers/br/eti/andersonq   line 1  Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'br.eti.andersonq.UploadrController'.    UploadrController.groovy    /uploadr-Grails2.3.3-JDK7/grails-app/controllers/br/eti/andersonq   line 1  Java Problem
The resource is a duplicate of .link_to_grails_plugins/resources-1.2.9-SNAPSHOT/grails-app/i18n/messages.properties and was not copied to the output folder messages.properties /Blogito/.link_to_grails_plugins/uploadr-0.8.2/grails-app/i18n  Unknown Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.   DbdocController.groovy  /uploadr-Grails2.3.3-JDK7/.link_to_grails_plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration   line 1  Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.   DbdocController.groovy  /uploadr-Grails2.3.3-JDK7/.link_to_grails_plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration   line 1  Java Problem

【讨论】:

    【解决方案2】:

    终于找到了解决一切的办法\o/

    uploadr 似乎不适用于任何高于 2.3.3 的 grails 版本

    错误“Groovy:Repetitive method name/signature”是由于 grails 2.3.3 和 JDK8 之间的不兼容造成的。但是,要正确解决,还需要将 STS.ini 从 spring 更改为使用 JDK7。因为即使我在 spring 中更改了所有系统和偏好以使用 JDK7,但这还不够。

    STS.ini 位于:

    springsource/sts-3.5.1.RELEASE/STS.ini
    

    并添加/更改:

    -vm
    /path/to/your/jdk/installation
    

    对我来说是:

    -vm
    /usr/lib/jvm/jdk1.7.0_65/bin/java
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多