由于研究需要,使用GATE框架来处理网页内容,在使用JAPE进行注释匹配后,RHS中如果出现Java代码错误,则会出现下面的提示。
gate.creole.ResourceInstantiationException: Error while parsing the grammar (file:/E:/SemanticAnnotation/japea.jape):
at gate.creole.Transducer.init(Transducer.java:124)
at gate.creole.AbstractProcessingResource.reInit(AbstractProcessingResource.java:60)
at gate.gui.NameBearerHandle$ReloadAction$1.run(NameBearerHandle.java:1413)
at java.lang.Thread.run(Thread.java:722)
Caused by: gate.util.GateRuntimeException: gate.util.GateException: There were errors; see error log for details!
at gate.jape.SinglePhaseTransducer.finish(SinglePhaseTransducer.java:169)
at gate.jape.MultiPhaseTransducer.finish(MultiPhaseTransducer.java:127)
at gate.jape.Batch.parseJape(Batch.java:223)
at gate.jape.Batch.<init>(Batch.java:91)
at gate.creole.Transducer.init(Transducer.java:106)
... 3 more
Caused by: gate.util.GateException: There were errors; see error log for details!
at gate.util.compilers.Eclipse.compile(Eclipse.java:425)
at gate.util.Javac.loadClasses(Javac.java:46)
at gate.jape.SinglePhaseTransducer.finish(SinglePhaseTransducer.java:166)
... 7 more
此时,解决方法是,重新查看在RHS中代码有没有错误,由于没有指向哪一行代码错误,所以调试起来要一行行去对比有难度。
建议是新建工程,引入所有的包,把RHS中代码放到新工程中查看,比较容易看到问题所在。