无法运行Grails,解析类时出错

时间:2016-03-02 10:32:58

标签: java grails

我对grails相当陌生,需要帮助找出由于以下错误导致我无法运行grails的原因:

grails> run-app
| Running application...
startup failed:
C:\DIR\grails-inventory\grails-app\controllers\harbor\AssetController.groovy: 3: unable to resolve class     org.apache.jasper.compiler.Node.ParamsAction
 @ line 3, column 1.
import org.apache.jasper.compiler.Node.ParamsAction;
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.

如果我要在AssetController中注释掉该特定行,则grails将执行,但整个应用程序将出现NullPointer错误

1 个答案:

答案 0 :(得分:0)

尝试将此添加到Gradle依赖项:

dependencies { 
    // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g. 
    // runtime 'mysql:mysql-connector-java:5.1.22'
    compile 'tomcat:jasper-compiler:5.5.9'
}

你可以找到Grails 2.x的jasper:https://grails.org/plugin/jasper和Grails 3.x的插件在这里:https://bintray.com/grails/plugins,但是我看到没有Grails 3的Jasper插件,所以试试如上所述直接添加依赖。