当前位置: 首页 > 知识库问答 >
问题:

生成器上的Xtext MWE2工作流崩溃

公孙弘深
2023-03-14

我目前正在为一个遗留项目创建一个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个答案

钱承允
2023-03-14

根据您的评论,不能提供关于该项目的进一步信息。相反,您正在寻找进一步调查根本原因的可能性。

我建议使用MVNDebug。这个命令随Maven一起提供,允许您调试Maven插件的执行。为了正确地设置它,您需要一个带有插件源代码的eclipse(或其他IDE)。我猜,您正在使用xtext-maven-plugin,如链接所示。要获得源代码,我找到的最简单的方法是使用插件作为依赖项设置一个新的Maven项目。确保版本相同,否则调试会产生有趣的结果。

<dependency>
    <groupId>org.eclipse.xtext</groupId>
    <artifactId>xtext-maven-plugin</artifactId>
    <version>${xtext-version}</version>
</dependency>

在要调查的类中设置一个断点(例如org.eclipse.internal.xpand2.parser.xpandparser.template(xpandparser.java:489)),然后使用

mvnDebug verify
mvn verify

然后,Maven将等待远程调试器附加到其进程。在Eclipse中,创建Remote Java Application类型的新调试配置,并通过Debug按钮启动它。

从那里,您可以使用标准的调试技术来查看错误发生的位置。

 类似资料:
  • 我正在迁移jenkins工作流作业到新的基于模板的工作流作业。因为构建号被用作工作流生成的构建工件版本的一部分,所以我必须以大于旧工作流的数量开始新工作流的构建号。不幸的是,下一个构建号插件不适用于工作流管道。 有人知道这样做的好方法吗?

  • 我正在使用openapi生成器生成服务器存根python代码。一切正常,但是,每次我修改OpenAPI规范(yaml文件),代码生成器都会覆盖整个代码,甚至是定制的代码(控制器)。我想开发一个增量工作流,如果我对规范进行了更改,生成器将只修改处理该部分代码的代码。 如果我能够执行规范并拥有一个增量工作流,那就太好了。 我使用的是openapi生成器版本3.3。4. 我试图修改控制器并删除,但每次我

  • 我对屏幕生成器有一些问题 对于某些fxml,它会在加载后发生creash。我尝试了很多次运行它,但它阻塞了,我必须终止这个进程。 fxml正常,内容在我的应用程序中正确显示。下面是导致场景生成器崩溃的FXML示例。

  • 问题内容: 关闭。 此问题不符合堆栈溢出准则。它当前不接受答案。 想改善这个问题吗? 更新问题,使其成为Stack Overflow 的主题。 9个月前关闭。 改善这个问题 我需要一个用于在Java中生成控制流的工具,而不是可视化绘制的工具,我可以使用它来处理类似路径条件之类的东西。任何人 ? 问题答案: 为了将来记录,我发现最适合我的需求的是Soot。 http://www.sable.mcgi

  • 我正在以编程方式运行Mwe2工作流,为了成功运行此工作流,我需要将Terminals.xtext的referencedResource添加到GenerateYourdsl.Mwe2文件中。提到的GenerateYourdsl.mwe2文件是在我创建新项目时由Xtext生成的--我没有修改它。是否有可能从这个工作流中获取对象,用Java访问它,并将这个属性添加到工作流组件属性的语言属性中? 以下是工

  • 问题内容: 我有以下代码: 我不确定这是否正确,但是我在互联网上发现的信息残片使我认为它应该起作用。基本上,我想分块地流式传输文件,为此,我要从应用程序函数传回一个生成器。但是,这仅打印出标题,而实际上没有发送回任何数据,有人可以告诉我为什么吗? 或者,如果这是完全错误的,那么执行此操作的最佳方法是什么?我无法将整个文件缓冲在内存中,因为我将要使用的文件可能是千兆字节。 第三级问题:一旦完成输出,