我目前正在为一个遗留项目创建一个maven构建,并尝试在maven构建中编译xtext语言,如下所述。我可以运行构建,但一旦maven启动xtext mwe2工作流,工作流中就会出现以下问题:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator)
org.eclipse.internal.xtend.xtend.parser.ParseException: extraneous input '-' expecting TEXT on line 289
at org.eclipse.internal.xpand2.parser.XpandParseFacade$3.handleError(XpandParseFacade.java:74)
at org.eclipse.internal.xpand2.parser.XpandParseFacade$2.reportError(XpandParseFacade.java:63)
at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:596)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
at org.eclipse.internal.xpand2.parser.XpandParser.template(XpandParser.java:489)
at org.eclipse.internal.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:40)
at org.eclipse.internal.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:27)
at org.eclipse.xpand2.XpandExecutionContextImpl$1.parse(XpandExecutionContextImpl.java:174)
at org.eclipse.xtend.expression.ResourceManagerDefaultImpl.loadResource(ResourceManagerDefaultImpl.java:70)
at org.eclipse.xpand2.XpandExecutionContextImpl.findTemplate(XpandExecutionContextImpl.java:286)
at org.eclipse.xpand2.XpandExecutionContextImpl.findTemplate(XpandExecutionContextImpl.java:281)
at org.eclipse.xpand2.XpandExecutionContextImpl.findDefinition(XpandExecutionContextImpl.java:233)
at org.eclipse.internal.xpand2.ast.ExpandStatement.invokeDefinition(ExpandStatement.java:236)
at org.eclipse.internal.xpand2.ast.ExpandStatement.evaluateInternal(ExpandStatement.java:228)
at org.eclipse.internal.xpand2.ast.Statement.evaluate(Statement.java:41)
at org.eclipse.internal.xpand2.ast.AbstractDefinition.evaluate(AbstractDefinition.java:176)
at org.eclipse.xpand2.XpandFacade.evaluate2(XpandFacade.java:62)
at org.eclipse.xtext.generator.AbstractGeneratorFragment.generate(AbstractGeneratorFragment.java:42)
at org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment.generate(AbstractAntlrGeneratorFragment.java:98)
at org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment.generate(XtextAntlrGeneratorFragment.java:41)
at org.eclipse.xtext.generator.DefaultGeneratorFragment.generate(DefaultGeneratorFragment.java:122)
at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:154)
at org.eclipse.xtext.generator.Generator.generate(Generator.java:396)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:138)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254)
at java.lang.Thread.run(Thread.java:748)
java.lang.RuntimeException: Problems running workflow at.jku.mevss.cdsl.GenerateConstraintDSL:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator)
org.eclipse.internal.xtend.xtend.parser.ParseException: extraneous input '-' expecting TEXT on line 289
at org.eclipse.internal.xpand2.parser.XpandParseFacade$3.handleError(XpandParseFacade.java:74)
at org.eclipse.internal.xpand2.parser.XpandParseFacade$2.reportError(XpandParseFacade.java:63)
at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:596)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
at org.eclipse.internal.xpand2.parser.XpandParser.template(XpandParser.java:489)
at org.eclipse.internal.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:40)
at org.eclipse.internal.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:27)
at org.eclipse.xpand2.XpandExecutionContextImpl$1.parse(XpandExecutionContextImpl.java:174)
at org.eclipse.xtend.expression.ResourceManagerDefaultImpl.loadResource(ResourceManagerDefaultImpl.java:70)
at org.eclipse.xpand2.XpandExecutionContextImpl.findTemplate(XpandExecutionContextImpl.java:286)
at org.eclipse.xpand2.XpandExecutionContextImpl.findTemplate(XpandExecutionContextImpl.java:281)
at org.eclipse.xpand2.XpandExecutionContextImpl.findDefinition(XpandExecutionContextImpl.java:233)
at org.eclipse.internal.xpand2.ast.ExpandStatement.invokeDefinition(ExpandStatement.java:236)
at org.eclipse.internal.xpand2.ast.ExpandStatement.evaluateInternal(ExpandStatement.java:228)
at org.eclipse.internal.xpand2.ast.Statement.evaluate(Statement.java:41)
at org.eclipse.internal.xpand2.ast.AbstractDefinition.evaluate(AbstractDefinition.java:176)
at org.eclipse.xpand2.XpandFacade.evaluate2(XpandFacade.java:62)
at org.eclipse.xtext.generator.AbstractGeneratorFragment.generate(AbstractGeneratorFragment.java:42)
at org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment.generate(AbstractAntlrGeneratorFragment.java:98)
at org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment.generate(XtextAntlrGeneratorFragment.java:41)
at org.eclipse.xtext.generator.DefaultGeneratorFragment.generate(DefaultGeneratorFragment.java:122)
at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:154)
at org.eclipse.xtext.generator.Generator.generate(Generator.java:396)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:138)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254)
at java.lang.Thread.run(Thread.java:748)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator)
org.eclipse.internal.xtend.xtend.parser.ParseException: extraneous input '-' expecting TEXT on line 289
at org.eclipse.internal.xpand2.parser.XpandParseFacade$3.handleError(XpandParseFacade.java:74)
at org.eclipse.internal.xpand2.parser.XpandParseFacade$2.reportError(XpandParseFacade.java:63)
at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:596)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
at org.eclipse.internal.xpand2.parser.XpandParser.template(XpandParser.java:489)
at org.eclipse.internal.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:40)
at org.eclipse.internal.xpand2.parser.XpandParseFacade.file(XpandParseFacade.java:27)
at org.eclipse.xpand2.XpandExecutionContextImpl$1.parse(XpandExecutionContextImpl.java:174)
at org.eclipse.xtend.expression.ResourceManagerDefaultImpl.loadResource(ResourceManagerDefaultImpl.java:70)
at org.eclipse.xpand2.XpandExecutionContextImpl.findTemplate(XpandExecutionContextImpl.java:286)
at org.eclipse.xpand2.XpandExecutionContextImpl.findTemplate(XpandExecutionContextImpl.java:281)
at org.eclipse.xpand2.XpandExecutionContextImpl.findDefinition(XpandExecutionContextImpl.java:233)
at org.eclipse.internal.xpand2.ast.ExpandStatement.invokeDefinition(ExpandStatement.java:236)
at org.eclipse.internal.xpand2.ast.ExpandStatement.evaluateInternal(ExpandStatement.java:228)
at org.eclipse.internal.xpand2.ast.Statement.evaluate(Statement.java:41)
at org.eclipse.internal.xpand2.ast.AbstractDefinition.evaluate(AbstractDefinition.java:176)
at org.eclipse.xpand2.XpandFacade.evaluate2(XpandFacade.java:62)
at org.eclipse.xtext.generator.AbstractGeneratorFragment.generate(AbstractGeneratorFragment.java:42)
at org.eclipse.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment.generate(AbstractAntlrGeneratorFragment.java:98)
at org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment.generate(XtextAntlrGeneratorFragment.java:41)
at org.eclipse.xtext.generator.DefaultGeneratorFragment.generate(DefaultGeneratorFragment.java:122)
at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:154)
at org.eclipse.xtext.generator.Generator.generate(Generator.java:396)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:138)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254)
at java.lang.Thread.run(Thread.java:748)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.handleIssues(Mwe2Bridge.java:56)
at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:48)
at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
... 6 more
我已经搜索了一点,试图找到一种方法,使发电机更详细,但找不到任何东西。不幸的是,我无法从错误消息中真正找到错误的来源,因为它说导致问题的元素是未知的。
我还用该语言手动检查了.xtext文件中是否有任何松散的“-”符号,但找不到。关于如何调试这个问题有什么线索吗?我甚至不知道从哪里开始挖掘。
1条答案
按热度按时间jum4pzuy1#
根据您的意见,无法提供有关该项目的更多信息。相反,你正在寻找一种可能性,进一步调查根本原因是什么。
我建议使用
mvnDebug
. 此命令随maven一起提供,允许您调试maven插件的执行。要正确设置它,您需要一个带有插件源代码的eclipse(或任何ide)。我猜,你用的是xtext-maven-plugin
如链接所示。为了获得源代码,我找到的最简单的方法是使用插件作为依赖项来设置一个新的maven项目。确保版本相同,否则调试会产生有趣的结果。在要调查的类中设置断点(例如。g。
org.eclipse.internal.xpand2.parser.XpandParser.template(XpandParser.java:489)
)然后你用(或任何你使用的目标)而不是
然后,maven将等待远程调试器附加到其进程。在eclipse中,您将创建一个类型为的新调试配置
Remote Java Application
并通过调试按钮启动。在那里,您可以使用标准调试技术来查看错误发生的位置。