Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing
Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1232674] Fri, 17 January 2014 13:18 Go to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Where org.eclipse.xtext.xbase.validation.XtypeJavaValidator is supposed to be?

Xtext needs it in a generated file Abstract*DslJavaValidator. This type replaces org.eclipse.xtext.validation.AbstractDeclarativeValidator from Xtext 2.3.0 but I can't find this class anywhere in Xtext 2.4.1.

2.4 has XbaseJavaValidator but I'm not sure whether I should use this (the code being generated by Xtext and the access to this class being discouraged).

Are there instructions anywhere how to upgrade from 2.3 to 2.4?
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1232741 is a reply to message #1232674] Fri, 17 January 2014 16:05 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Note: I've opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=425869 as a first step to help solving such issues in the future: Generators should leave their name (or the classname) in the source to make it easier to figure out where to look for a solution.
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1232826 is a reply to message #1232741] Fri, 17 January 2014 21:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13662
Registered: July 2009
Senior Member
Hi,

to find out about the generators have a look at the bindings in AbstractMyDslRuntimeModule


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1233681 is a reply to message #1232826] Mon, 20 January 2014 09:14 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Christian Dietrich wrote on Fri, 17 January 2014 22:20
to find out about the generators have a look at the bindings in AbstractMyDslRuntimeModule


Hi Christian,

The generators are selected in the MWE2 workflow file. AbstractMyDslRuntimeModule is a file which is generated from this step, so I can't see how any generator could depend on it.

Which generator creates Abstract*DslJavaValidator?
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1233717 is a reply to message #1233681] Mon, 20 January 2014 10:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13662
Registered: July 2009
Senior Member
Have a look AT the comments in the abstract module (the one that
binds the validator)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1234280 is a reply to message #1233717] Tue, 21 January 2014 15:57 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Ah! Here we go:

// contributed by org.eclipse.xtext.generator.validation.JavaValidatorFragment


This code seems to be relevant:

	protected String getValidatorSuperClassName(Grammar grammar) {
		Grammar superGrammar = Util.getNonTerminalsSuperGrammar(grammar);
		if (isInheritImplementation() && superGrammar != null) 
			return getValidatorName(superGrammar, "", getNaming());
		else 
			return getDefaultValidatorSuperClassName();
	}

	protected String getDefaultValidatorSuperClassName() {
		return "org.eclipse.xtext.validation.AbstractDeclarativeValidator";
	}


Debugging this tells me that my super grammar is
org.eclipse.xtext.xbase.Xtype
for which getValidatorName() returns
org.eclipse.xtext.xbase.validation.XtypeJavaValidator


Isn't Xtype supported anymore for Xtext 2.4? Do I have to move to Xbase?
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1234292 is a reply to message #1234280] Tue, 21 January 2014 16:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13662
Registered: July 2009
Senior Member
Hi maybe you can switch to validatorfragment. It is the new default
and may be not that buggy

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 21 January 2014 21:11]

Report message to a moderator

Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1235025 is a reply to message #1234292] Thu, 23 January 2014 11:26 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
You mean I should replace validation.JavaValidatorFragment with validation.ValidatorFragment in my MWE2?

Doesn't work; still asks for XtypeValidator.

I now tried changing my grammar to use Xbase but that makes about 80% of my tests suddenly fail; no idea why Sad
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1235031 is a reply to message #1235025] Thu, 23 January 2014 11:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13662
Registered: July 2009
Senior Member
can you please file a bug with grammar attached?
do you have any typesgenerator or xbase fragements in use?


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Upgrade from Xtext 2.3.0 to 2.4.1: org.eclipse.xtext.xbase.validation.XtypeJavaValidator missing [message #1235121 is a reply to message #1235031] Thu, 23 January 2014 16:15 Go to previous message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
This happens in the first three lines:

grammar com.pany.project.dsl.MyDsl
	with org.eclipse.xtext.xbase.Xtype
	hidden(WS, SL_COMMENT) 


the second line triggers the error.

Bug report is: https://bugs.eclipse.org/bugs/show_bug.cgi?id=426478

It compiles when you replace "Xtype" with "Xbase". But if I do, this stops working:

"class" clsName=[ jvmTypes::JvmType | QualifiedName ] ";"


In my tests, I see a lot of these errors:

Couldn't resolve reference to JvmType ''. (testMissingI18n.mset line : 14)

Instead of JvmType, I get JvmVoid all of a sudden and I have no idea what is going on Sad

[Updated on: Thu, 23 January 2014 16:19]

Report message to a moderator

Previous Topic:Injection not working when Xtezt is launch from EMF model
Next Topic:Xtext on the Web
Goto Forum:
  


Current Time: Mon Nov 30 09:30:31 GMT 2020

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

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

Back to the top