Grails Plugin Uploadr无法运行

时间:2014-07-16 15:30:47

标签: grails grails-plugin

我尝试使用上传器,但我无法将其投入使用......即使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

然而,服务器启动,但是当我尝试使用uploadr打开页面时,我收到此错误:

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>

BuildConfig:

    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。好吧,我得到了2.3.3的grails,而且它再次没有用。这次是一个新错误:

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上思考或找到的东西......有什么想法吗?

2 个答案:

答案 0 :(得分:0)

我管理了一项工作,它正在运行,但仍有错误...... 我安装了Grails 2.3.3和Oracle jdk1.7.0_65。使用它们我可以创建一个上传器工作的新项目,我也可以运行uploadr-demo,但都有以下错误:

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

答案 1 :(得分:0)

最后,我找到了一切解决方案\ o /

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

错误'Groovy:重复方法名称/签名'是由于grails 2.3.3和JDK8之间不兼容。但是要正确解决,还需要从Spring更改STS.ini以使用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