我有一个Xtext语法,当我尝试生成Xtext工件时抛出异常(它开始并最终抛出异常)。
我的大纲(前几行):
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\Users\Robert Adam\Documents\eclipse.luna\workspace'
451 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
701 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
701 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
717 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
717 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
1904 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
1916 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf\src-gen
2076 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf\model\generated
2077 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf.ui\src-gen
2081 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning C:\Users\Robert Adam\Documents\eclipse.luna\workspace\raven.sqf\..\raven.sqf.tests\src-gen
8449 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.SQF.raven' from 'platform:/resource/raven.sqf/model/generated/SQF.genmodel'
164592 [main] INFO text.generator.junit.Junit4Fragment - generating Junit4 Test support classes
164692 [main] INFO text.generator.junit.Junit4Fragment - generating Compare Framework infrastructure
164707 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow raven.GenerateSQF:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator)
org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
at org.eclipse.xtext.generator.parser.antlr.AntlrToolFacade.runWithEncodingAndParams(AntlrToolFacade.java:183)
at org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment.generate(XtextAntlrGeneratorFragment.java:48)
at org.eclipse.xtext.generator.DefaultGeneratorFragment.generate(DefaultGeneratorFragment.java:167)
at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:163)
at org.eclipse.xtext.generator.Generator.generate(Generator.java:555)
at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:172)
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)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.generator.parser.antlr.AntlrToolFacade.runWithEncodingAndParams(AntlrToolFacade.java:173)
... 15 more
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.HashMap.newTreeNode(Unknown Source)
at java.util.HashMap$TreeNode.putTreeVal(Unknown Source)
at java.util.HashMap.putVal(Unknown Source)
at java.util.HashMap.put(Unknown Source)
at java.util.HashSet.add(Unknown Source)
at org.antlr.misc.OrderedHashSet.add(OrderedHashSet.java:63)
at org.antlr.analysis.DFAState.addNFAConfiguration(DFAState.java:226)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:633)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:765)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:683)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
at org.antlr.analysis.NFAToDFAConverter.closure(NFAToDFAConverter.java:709)
我的猜测是问题是由内存问题引起的......这是正确的吗?如果是这样我怎么能避免这种情况?
最好的问候Raven