Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » ERROR org.eclipse.xtext.builder.impl.XtextBuilder - java.lang.ClassCastException: org.eclipse.xtext
ERROR org.eclipse.xtext.builder.impl.XtextBuilder - java.lang.ClassCastException: org.eclipse.xtext [message #1215955] Thu, 28 November 2013 04:01 Go to next message
Aaron Digulla is currently offline Aaron Digulla
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
I see this a lot in my log:

ERROR org.eclipse.xtext.builder.impl.XtextBuilder  - java.lang.ClassCastException: org.eclipse.xtext.impl.KeywordImpl cannot be cast to org.eclipse.xtext.RuleCall
org.eclipse.xtext.parser.ParseException: java.lang.ClassCastException: org.eclipse.xtext.impl.KeywordImpl cannot be cast to org.eclipse.xtext.RuleCall
        at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:105)
        at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.parse(AbstractAntlrParser.java:84)
        at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:62)
        at org.eclipse.xtext.parser.AbstractParser.parse(AbstractParser.java:32)
        at org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:162)
        at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:81)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
        at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:201)
...
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.ClassCastException: org.eclipse.xtext.impl.KeywordImpl cannot be cast to org.eclipse.xtext.RuleCall
        at org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser.parse(AbstractInternalAntlrParser.java:555)
        at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:102)
        ... 30 more
Caused by: java.lang.ClassCastException: org.eclipse.xtext.impl.KeywordImpl cannot be cast to org.eclipse.xtext.RuleCall
        at org.eclipse.xtext.xbase.services.XtypeGrammarAccess$JvmTypeReferenceElements.<init>(XtypeGrammarAccess.java:28)
        at org.eclipse.xtext.xbase.services.XtypeGrammarAccess.getJvmTypeReferenceAccess(XtypeGrammarAccess.java:615)
        at com.pany.eclipse.foo_dsl.services.FooDslGrammarAccess.getJvmTypeReferenceAccess(FooDslGrammarAccess.java:1092)
        at com.pany.eclipse.foo_dsl.parser.antlr.internal.InternalFooDslParser.ruleJvmTypeReference(InternalFooDslParser.java:3878)
        at com.pany.eclipse.foo_dsl.parser.antlr.internal.InternalFooDslParser.ruleFormatterDefinition(InternalFooDslParser.java:1649)
        at com.pany.eclipse.foo_dsl.parser.antlr.internal.InternalFooDslParser.ruleFooDomainModel(InternalFooDslParser.java:386)
        at com.pany.eclipse.foo_dsl.parser.antlr.internal.InternalFooDslParser.entryRuleFooDomainModel(InternalFooDslParser.java:111)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser.parse(AbstractInternalAntlrParser.java:532)
        ... 31 more


I have these features installed:

org.eclipse.xtext.docs_2.4.3.v201309030823
org.eclipse.xtext.examples_2.4.3.v201309030823
org.eclipse.xtext.redist_2.4.3.v201309030823
org.eclipse.xtext.runtime_2.4.3.v201309030823
org.eclipse.xtext.sdk_2.4.3.v201309030823
org.eclipse.xtext.ui_2.4.3.v201309030823
org.eclipse.xtext.xbase_2.4.3.v201309030823
org.eclipse.xtext.xbase.lib_2.4.3.v201309030823
org.eclipse.xtext.xtext.ui_2.4.3.v201309030823


Any ideas what I should do next?

[Updated on: Thu, 28 November 2013 04:04]

Report message to a moderator

Re: ERROR org.eclipse.xtext.builder.impl.XtextBuilder - java.lang.ClassCastException: org.eclipse.x [message #1219174 is a reply to message #1215955] Mon, 02 December 2013 08:27 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1759
Registered: July 2009
Senior Member
Can you share the grammar that cuases this and attach it to a bugzilla?

Am 11/28/13 10:01 AM, schrieb Aaron Digulla:
> I see this a lot in my log:
>
> ERROR org.eclipse.xtext.builder.impl.XtextBuilder -
> java.lang.ClassCastException: org.eclipse.xtext.impl.KeywordImpl cannot
> be cast to org.eclipse.xtext.RuleCall
> org.eclipse.xtext.parser.ParseException: java.lang.ClassCastException:
> org.eclipse.xtext.impl.KeywordImpl cannot be cast to
> org.eclipse.xtext.RuleCall
> at
> org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:105)
>
> at
> org.eclipse.xtext.parser.antlr.AbstractAntlrParser.parse(AbstractAntlrParser.java:84)
>
> at
> org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:62)
>
> at
> org.eclipse.xtext.parser.AbstractParser.parse(AbstractParser.java:32)
> at
> org.eclipse.xtext.resource.XtextResource.doLoad(XtextResource.java:162)
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLoad(LazyLinkingResource.java:81)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
>
> at
> org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:201)
>
>
>
> I have these features installed:
>
>
> org.eclipse.xtext.docs_2.4.3.v201309030823
> org.eclipse.xtext.examples_2.4.3.v201309030823
> org.eclipse.xtext.redist_2.4.3.v201309030823
> org.eclipse.xtext.runtime_2.4.3.v201309030823
> org.eclipse.xtext.sdk_2.4.3.v201309030823
> org.eclipse.xtext.ui_2.4.3.v201309030823
> org.eclipse.xtext.xbase_2.4.3.v201309030823
> org.eclipse.xtext.xbase.lib_2.4.3.v201309030823
> org.eclipse.xtext.xtext.ui_2.4.3.v201309030823
>
>
> Any ideas what I should do next?


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: ERROR org.eclipse.xtext.builder.impl.XtextBuilder - java.lang.ClassCastException: org.eclipse.x [message #1237020 is a reply to message #1219174] Tue, 28 January 2014 11:25 Go to previous message
Aaron Digulla is currently offline Aaron Digulla
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
See this blog post for a solution: http://www.eclipse.org/forums/index.php/t/461977/

In a nutshell, you see this error if you try to use a plugin with a different version of Xbase. So if your plugin was generated with Xbase 2.3 and you install it in e4 with Xbase 2.4, you get these errors.
Previous Topic:Synchronisation between different grammars for the same ecore xtext model
Next Topic:antlr error with the workflow file
Goto Forum:
  


Current Time: Wed Jul 30 17:30:04 EDT 2014

Powered by FUDForum. Page generated in 0.01836 seconds