Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cannot find compatible feature name(Xtext setup after migrating to Xtext 2.15)
Cannot find compatible feature name [message #1842781] Thu, 01 July 2021 10:38 Go to next message
Frä Fröhlich is currently offline Frä FröhlichFriend
Messages: 18
Registered: June 2021
Junior Member
Hi,
I migrated down from Xtext 2.25 to 2.15, because I had some depency issues.
Now, my grammar throws the error:
Cannot find compatible feature name in sealed EClass JavaStatement
from imported package http://www.example.org/cbcmodel: The type
'XExpression' used in the reference 'name' is inconsistent.
Probably this is due to an unsupported kind of metamodel hierarchy.

Here is my rule:
JavaStatement returns JavaStatement:
	(name+=XExpression)+;

and my ecore for that piece:
<eClassifiers xsi:type="ecore:EClass" name="JavaStatement">
    <eStructuralFeatures xsi:type="ecore:EReference" name="name" upperBound="-1" eType="ecore:EClass ../../org.eclipse.xtext.xbase/model/Xbase.ecore#//XExpression"
        containment="true"/>
...


The code worked in Xtext 2.25.
Re: Cannot find compatible feature name [message #1842783 is a reply to message #1842781] Thu, 01 July 2021 10:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14026
Registered: July 2009
Senior Member
maybe its better to have a namespace uri the or a platform:/resource/org.eclipse.xtext.xbase/model/Xbase.ecore#//XExpression

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: Cannot find compatible feature name [message #1842786 is a reply to message #1842783] Thu, 01 July 2021 11:33 Go to previous messageGo to next message
Frä Fröhlich is currently offline Frä FröhlichFriend
Messages: 18
Registered: June 2021
Junior Member
I tried to use the platform url you provided.
This doesn't solve the problem.

Using "ecore:EClass http://www.eclipse.org/xtext/xbase/Xbase#//XExpression" as eType did thrown an error the package ... has the same namespace URI ...

I also tried importing the uri in the .xtext file:
import "http://www.eclipse.org/xtext/xbase/Xbase"


This didn't do anything either.
Re: Cannot find compatible feature name [message #1842801 is a reply to message #1842786] Thu, 01 July 2021 16:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7220
Registered: July 2009
Senior Member
Hi

Moving from 2.25 to 2.15 is a long way. Have you changed everything consistently? Java compatibility has changed significantly in that time.

You only provide snippets that make it almost impossible to divine what you are really doing.

Comparing my grammars with their four-year old counterparts, I find very little structural change. However I have obstinately refused to move on from manual metamodels referenced as

Quote:
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "platform:/resource/org.eclipse.ocl.pivot/model/Pivot.ecore" as pivot


despite Xtext tooling encouragement to change. Your comment suggests you may not be using platform:/resource for cbcmodel.

Regards

Ed Willink
Re: Cannot find compatible feature name [message #1842806 is a reply to message #1842801] Thu, 01 July 2021 18:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14026
Registered: July 2009
Senior Member
Maybe you can debug where
The Xbase.ecore is loaded twice from different resources
Besides that can you provide a reproducer



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: Cannot find compatible feature name [message #1842807 is a reply to message #1842806] Thu, 01 July 2021 18:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14026
Registered: July 2009
Senior Member
BTW what is the reason you want to downport to 2.15
There was some bugs fixed since then
Maybe this is one of them


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: Cannot find compatible feature name [message #1842815 is a reply to message #1842807] Fri, 02 July 2021 06:18 Go to previous messageGo to next message
Frä Fröhlich is currently offline Frä FröhlichFriend
Messages: 18
Registered: June 2021
Junior Member
Background: long story short:
I am working on an old project started with xtext 2.10.
Shortly I was switching to XBase->JBase and needed a newer Xtext version for that. So I migrated to 2.25.
Unfortunately, a dependency doesn't work with Xtext 2.25 (see https://stackoverflow.com/questions/67618045/key-formal-verification-with-xtext-2-25).
First, I got rid of that dependency, but I really would like to use this library and therefore migrate back to 2.15 (which at least works with the dep).

I am using an existing ecore model, because I have a textual and graphical editor which use the same model.
Here is my repo https://github.com/Babwenbiber/CorC/tree/develop
Model is in de.tu-bs.cs.isf.cbc.model
Xtext resources in de.tu_bs.cs.isf.cbc.textual.tool

P.S. If You check out the repo you will get some errors in ....tool, you might ignore them, because they come from the graphical editor.
Re: Cannot find compatible feature name [message #1842817 is a reply to message #1842815] Fri, 02 July 2021 06:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7220
Registered: July 2009
Senior Member
Hi

Quote:
org.eclipse.core.runtime.CoreException: No property tester contributes a property org.key_project.keyide.ui.isGoal to type class org.eclipse.jface.text.TextSelection


The stackoverflow post shows that you are being totally distracted by a red herring.

The problem is a bad property tester from a third party project. Only mainstream Eclipse plugins are on the stack. Changing Eclipse versions is very unlikely to cure anything, rather it will give you extra incompatibilities to further distract.

You need to debug where org.key_project.keyide.ui.isGoal is referenced, where defined, why now present. Then you can set about remedying the missing definiotion that causes your stack trace.

Regards

Ed Willink
Re: Cannot find compatible feature name [message #1842836 is a reply to message #1842817] Fri, 02 July 2021 12:20 Go to previous messageGo to next message
Frä Fröhlich is currently offline Frä FröhlichFriend
Messages: 18
Registered: June 2021
Junior Member
Ok, now I approved, that org.key_project.keyide is never used in my repo.
I upgraded Xtext to 2.25 again and after uninstalling org.key_project.keyide the project works.
However, the KeYIDE is a tool, which I would like to use (not integrate into source code).
When installed I can select some files in my eclipse instance and verify if they are correct (formal verification).

So I tried integrating it manually. I pulled the official KeY repohttps://git.key-project.org/key-public/key/ and installed KeYIDE from local in eclipse.
Somehow, eclipse won't some of the installed classes!?
!MESSAGE Plug-in org.key_project.keyide.ui was unable to load class org.key_project.keyide.ui.starter.KeYIDEProofStarter.
!STACK 0
java.lang.ClassNotFoundException: org.key_project.keyide.ui.starter.KeYIDEProofStarter cannot be found by org.key_project.keyide.ui_1.0.0.qualifier
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519)
...
Re: Cannot find compatible feature name [message #1842840 is a reply to message #1842836] Fri, 02 July 2021 12:37 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7220
Registered: July 2009
Senior Member
Hi

In the past, this would have been a 'simple' bad class path or missing dependency. Recently the new versions have Java have been moving things around in ways that I really do not understand. I just see much pain. Probably it is a simple problem but maybe KeyIDE is not suitable for the version of Java you use.

Regards

Ed Willink
Previous Topic:Issues with Xtext and Epsilon
Next Topic:Highlight keywords with dashes
Goto Forum:
  


Current Time: Thu Jul 29 00:32:31 GMT 2021

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

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

Back to the top