简体   繁体   English

使用Apache Camel插件安装Grails

[英]Installing Grails with Apache Camel plugin

I'm having trouble getting the Apache Camel plugin to run in grails-1.1.1. 我无法让Apache Camel插件在grails-1.1.1中运行。 Here's the steps I took: 这是我采取的步骤:

$ grails create-app camelapp
Welcome to Grails 1.1.1 - http://grails.org/
...

$ cd camelapp

$ grails run-app
...
Running Grails application..
Server running. Browse to http://localhost:8080/camelapp

$ grails install-plugin camel
...
Camel Route directory was created.
Plugin camel-0.2 installed
Plug-in provides the following new scripts:
------------------------------------------
grails create-route

$ grails run-app
...
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Compile error during compilation with javac.
  [groovyc] /Users/abdullah/.grails/1.1.1/projects/camelapp/plugins/camel-0.2/src/java/org/ix/grails/plugins/camel/ClosureProcessor.java:22: method does not override a method from its superclass
  [groovyc]     @Override
  [groovyc]          ^
...
: Compilation Failed
    at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:807)
    at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:540)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at _GrailsCompile_groovy$_run_closure3_closure7.doCall(_GrailsCompile_groovy:102)
    at _GrailsCompile_groovy$_run_closure3_closure7.doCall(_GrailsCompile_groovy)
    at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:274)
    at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
    at _GrailsCompile_groovy$_run_closure3.doCall(_GrailsCompile_groovy:89)
    at _GrailsCompile_groovy$_run_closure2.doCall(_GrailsCompile_groovy:55)
    at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy:79)
    at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy)
    at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:274)
    at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
    at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:78)
    at RunApp$_run_closure1.doCall(RunApp.groovy:28)
    at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
    at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
    at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:344)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:334)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.processTargets(Gant.groovy:495)
    at gant.Gant.processTargets(Gant.groovy:480)
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Compile error during compilation with javac.
/Users/abdullah/.grails/1.1.1/projects/camelapp/plugins/camel-0.2/src/java/org/ix/grails/plugins/camel/ClosureProcessor.java:22: method does not override a method from its superclass
    @Override
         ^
...
Compilation error: Compilation Failed

$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

There's a JIRA on this problem. 关于这个问题有一个JIRA Try to just delete the @Override on the ClosureProcessor.java file. 尝试仅删除ClosureProcessor.java文件上的@Override。

Seems that camel plugin for grails development is frozen. 似乎用于grails开发的骆驼插件被冻结了。 Besides that it's used camel 1.6.0 which is quite outdated. 除此之外,它还使用过时的骆驼1.6.0。 If you plan to move to camel2 one day - you will apparently have problems using camel plugin. 如果您计划有一天改用camel2,则使用骆驼插件显然会遇到问题。

I would not suggest you use it in your project, better add camel support manually, and bootstrap functions you need (eg sendMessage). 我不建议您在项目中使用它,最好不要手动添加骆驼支持,以及所需的引导程序功能(例如sendMessage)。 I've done this already. 我已经做到了。 Contact me PM if you need more hints on that. 如果您需要更多提示,请与我联系。

It seems that you are using JDK5, which do not allow @Override for interface implementations. 似乎您正在使用JDK5,该接口不允许@Override用于接口实现。 You need to set JDK6 as the default JVM, JDK6 allows @Override for interface implementations. 您需要将JDK6设置为默认JVM,JDK6允许@Override用于接口实现。

You can also open a jira for the apache camel plugin owner in order to remove the annotation, although JDK5 will not last much longer. 您也可以为apache camel插件所有者打开一个jira,以删除注释,尽管JDK5的使用时间不会更长。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM