Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » On using XtextAntlrGeneratorFragment2 in work flow getting java.lang.IllegalStateException (On using XtextAntlrGeneratorFragment2 in work flow getting java.lang.IllegalStateException )
On using XtextAntlrGeneratorFragment2 in work flow getting java.lang.IllegalStateException [message #1805702] Mon, 22 April 2019 08:46 Go to next message
Nagashree KN is currently offline Nagashree KNFriend
Messages: 20
Registered: September 2018
Junior Member
Hi,

I am splitting Grammar in two files. Reason is my Grammar is quit large and i ma getting error like "The code for the static initializer is exceeding the 65535 bytes limit".
to resolve that error after searching in forum i found solution, on using
fragment = parser.antlr.XtextAntlrGeneratorFragment2 {
options = {
classSplitting = true
fieldsPerClass = "200"
methodsPerClass = "200"
}
}
in workflow will solve the problem. But after running the workflow i am getting exception like ''java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker" .
FYI: I am using eclipse neon and xtext 2.10 .
I am attaching the files which will reproduce the problem.
My exception stacktrace looks like this -
25433 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow org.xtext.example.mydsl.GenerateMyDsl:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker
at org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker.attachToEmfObject(CombinedGrammarMarker.java:66)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:163)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:117)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker
at org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker.attachToEmfObject(CombinedGrammarMarker.java:66)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:163)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:117)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

java.lang.RuntimeException: Problems running workflow org.xtext.example.mydsl.GenerateMyDsl:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker
at org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker.attachToEmfObject(CombinedGrammarMarker.java:66)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:163)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:117)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker
at org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker.attachToEmfObject(CombinedGrammarMarker.java:66)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:163)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:117)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: java.lang.RuntimeException:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker
at org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker.attachToEmfObject(CombinedGrammarMarker.java:66)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:163)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:117)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker
at org.eclipse.xtext.xtext.generator.parser.antlr.CombinedGrammarMarker.attachToEmfObject(CombinedGrammarMarker.java:66)
at org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2.doGenerate(XtextAntlrGeneratorFragment2.java:163)
at org.eclipse.xtext.xtext.generator.parser.antlr.AbstractAntlrGeneratorFragment2.generate(AbstractAntlrGeneratorFragment2.java:117)
at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:48)
at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:202)
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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

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)
... 4 more

can any help in resolving the exception.

Thanks in advance!
Re: On using XtextAntlrGeneratorFragment2 in work flow getting java.lang.IllegalStateException [message #1805787 is a reply to message #1805702] Wed, 24 April 2019 05:06 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13164
Registered: July 2009
Senior Member
Don't add XtextAntlrGeneratorFragment2 a second time
It's already there implicitely

Put the options here

parserGenerator = {
//Here
}


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Provide Quick-fix for unrelated object while validation
Next Topic:Xtext Web: generate and save
Goto Forum:
  


Current Time: Thu Oct 24 03:10:21 GMT 2019

Powered by FUDForum. Page generated in 0.01560 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top