Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception
On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805703] Mon, 22 April 2019 08:53 Go to next message
Sharmila D is currently offline Sharmila DFriend
Messages: 81
Registered: June 2018
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.
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805706 is a reply to message #1805703] Mon, 22 April 2019 11:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

You seem to be splitting for a reason for which you have already found a workaround, so why bother?

If you want multiple grammars you need multiple everything including multiple MWE2 XtextGenerators. Otherwise as you have observed you get duplication conflicts.

If your grammar has plausible layers, splitting may be a good idea.

QVTrelation.xtext extends QVTbase.xtext extends EssentialOCL.xtext extends Base.xtext, so it can be done, but each layer is treated as a distinct Xtext development with its own model layer and workflow.

Recent Xtext developments with modules may facilitate a vertical rather than horizontal split.

Regards

Ed Willink
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805711 is a reply to message #1805706] Mon, 22 April 2019 13:42 Go to previous messageGo to next message
Sharmila D is currently offline Sharmila DFriend
Messages: 81
Registered: June 2018
Member
Thanks for the quick reply..
Actually here my main concern is to get rid of error "The code for the static initializer is exceeding the 65535 bytes limit".
I checked ,even for single grammar file also and after adding
fragment = parser.antlr.XtextAntlrGeneratorFragment2 {
options = {
classSplitting = true
fieldsPerClass = "200"
methodsPerClass = "200"
}
} in mwe2 file, i am getting exception "java.lang.IllegalStateException: The given EMF object already contains an adapter for CombinedGrammarMarker".
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805712 is a reply to message #1805711] Mon, 22 April 2019 14:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13153
Registered: July 2009
Senior Member
Please test if the problem is still there in Xtext 2.17.1

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805752 is a reply to message #1805711] Tue, 23 April 2019 07:33 Go to previous messageGo to next message
Sharmila D is currently offline Sharmila DFriend
Messages: 81
Registered: June 2018
Member
Hi

I am using Eclipse Neon 3 . Will Neon 3 supports Xtext 2.17.1 ?
I am trying to install Xtext 2.17.1 ,it is showing can not perform operation and details like this--
Cannot complete the install because one or more required items could not be found.
Software being installed: Xtext Complete SDK 2.17.1.v20190403-0733 (org.eclipse.xtext.sdk.feature.group 2.17.1.v20190403-0733)
Missing requirement: Xtext Documentation 2.17.1.v20190402-1603 (org.eclipse.xtext.doc 2.17.1.v20190402-1603) requires 'bundle org.eclipse.help 3.8.1' but it could not be found
Cannot satisfy dependency:
From: Xtext Documentation 2.17.1.v20190403-0733 (org.eclipse.xtext.docs.feature.group 2.17.1.v20190403-0733)
To: org.eclipse.xtext.doc [2.17.1.v20190402-1603]
Cannot satisfy dependency:
From: Xtext Complete SDK 2.17.1.v20190403-0733 (org.eclipse.xtext.sdk.feature.group 2.17.1.v20190403-0733)
To: org.eclipse.xtext.docs.feature.group [2.17.1.v20190403-0733]
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805753 is a reply to message #1805752] Tue, 23 April 2019 07:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13153
Registered: July 2009
Senior Member
That was not my question
No it's not supported (minimal tp is oxygen)
I want to know if the problem is still there in the latest Xtext


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805755 is a reply to message #1805753] Tue, 23 April 2019 07:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13153
Registered: July 2009
Senior Member
btw

adding XtextAntlrGeneratorFragment2 makes zero sense.
it is already there.

parserGenerator = {
debugGrammar = true
....
}


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805768 is a reply to message #1805753] Tue, 23 April 2019 12:03 Go to previous messageGo to next message
Sharmila D is currently offline Sharmila DFriend
Messages: 81
Registered: June 2018
Member
Hi

In eclipse Oxygen only I have used latest Xtext 2.17.1.But still Iam getting the error "The code for the static initializer is exceeding the 65535 bytes limit".
Any Suggestions .Please help me
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805772 is a reply to message #1805768] Tue, 23 April 2019 12:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13153
Registered: July 2009
Senior Member
Did you configure the parser generator with your options as shown above instead
Of adding the fragment a second time


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: On adding XtextAntlrGeneratorFragment2 in Workflow .Iam getting exception [message #1805773 is a reply to message #1805772] Tue, 23 April 2019 13:35 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

If you post a repro, we could possibly tell you what you have done wrong, rather than just guessing at possibilities.

Regards

Ed Willink

Previous Topic:XText 2.17 + eclipse 2019-03 + maven build problem
Next Topic:Provide Quick-fix for unrelated object while validation
Goto Forum:
  


Current Time: Tue Oct 15 15:09:03 GMT 2019

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

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

Back to the top