Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Couldn't resolve reference to JvmIdentifiableElement '=='
Couldn't resolve reference to JvmIdentifiableElement '==' [message #1118458] Fri, 27 September 2013 08:32 Go to next message
Michael Vorburger is currently offline Michael Vorburger
Messages: 60
Registered: July 2009
Member
Hello gurus, I'm hitting a Couldn't resolve reference to JvmIdentifiableElement '=='..

Any tips where exactly this (validation) error is created and how to start debugging this?

FYI We're hitting this while trying to move from Xtext 2.3.1 (all working) to 2.4.2 (currently broken) in https://github.com/vorburger/eLang/commits/v2.2_xtext-v2.4.2 .. the ch.vorburger.el.engine.tests.BasicExpressionGeneratorTest.testNotNull() illustrates this problem (if anybody does try; ignore other test failures related to problems in Interpreter Tests which broke as well following the update, they're less critical).

I've seen a number of posts re. this all saying "missing xbase.lib!", but that doesn't seem to be it (xbase.lib IS on ch.vorburger.el)... must be something more... interesting.

Any help much appreciated.
Re: Couldn't resolve reference to JvmIdentifiableElement '==' [message #1118559 is a reply to message #1118458] Fri, 27 September 2013 10:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 5843
Registered: July 2009
Senior Member
Hi,

this one is the problem (dont know why)

	@Override
	public Class<? extends org.eclipse.xtext.resource.XtextResource> bindXtextResource() {
		// NOT return org.eclipse.xtext.xbase.resource.BatchLinkableResource.class;
		// but let's use the classic older one (which I understand..), to debug more easily:
		return DerivedStateAwareResource.class;
	}
Re: Couldn't resolve reference to JvmIdentifiableElement '==' [message #1121430 is a reply to message #1118458] Mon, 30 September 2013 12:07 Go to previous messageGo to next message
Michael Vorburger is currently offline Michael Vorburger
Messages: 60
Registered: July 2009
Member
Christian, thank you for visibly having taking the time to look into the (diff) code!

Unfortunately it doesn't seem to be that easy.. even using XbaseResource instead of DerivedStateAwareResource still causes BasicExpressionGeneratorTest to fail. Using the original BatchLinkableResource doesn't cause a validation error anymore, but instead a java.lang.NullPointerException at org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.getFavoriteVariableName(AbstractXbaseCompiler.java:426) because ((XAbstractFeatureCall) ex).getFeature() is still an unresolved proxy - the same root cause most likely, just appearing differently.

I guess I'll have to dig more into this... side-by-side step before/after 2.3.1/2.4.2 debugging, what fun.
Re: Couldn't resolve reference to JvmIdentifiableElement '==' [message #1122677 is a reply to message #1121430] Tue, 01 October 2013 16:44 Go to previous message
Michael Vorburger is currently offline Michael Vorburger
Messages: 60
Registered: July 2009
Member
Managed to figure this out; just to wrap this up FTR, in case anybody hits something like this (no response needed, unless some you have some further insight so that I can learn something):

It seemed to have had something to do with org.eclipse.xtext.resource.XtextResource.RESOLVE_ALL=true when loading the (synthetic) resource.. I don't fully understand it, but it's reproducible: If you checkout commit fd5eed335ab51f0e3889815c7b426f1b005cc5f7 of https://github.com/vorburger/eLang, the BasicExpressionGeneratorTest works. If you now go into the ExpressionFactory and in line 109 pass resourceSet.getLoadOptions() instead of null, then testNotNull fails with Couldn't resolve reference to JvmIdentifiableElement '=='.

I've tried to provide a reproducible standalone example test case of this in https://github.com/vorburger/xtext-sandbox/tree/f63a74c328afb3a56ffd45deb07b0d5012c051d1/XbaseOptionResolveAllConfusion, but there what I thought was basically the same does work... so it must be the side effect of something else.

I learnt that I also had to write a *JvmModelInferrer, even though previously was not needed and I had assumed for the UC in Q here that was not needed.

[Updated on: Tue, 01 October 2013 16:44]

Report message to a moderator

Previous Topic:Model to Text error: resolution of uriFragment 'xtextLink ...
Next Topic:Problem with the generation of the artifact
Goto Forum:
  


Current Time: Thu Apr 17 05:56:28 EDT 2014

Powered by FUDForum. Page generated in 0.02133 seconds