Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Couldn't resolve reference to JvmIdentifiableElement 'generateStub'.(XText 2.3 Upgrade)
Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899041] Mon, 30 July 2012 10:19 Go to next message
Sreekanth SC is currently offline Sreekanth SCFriend
Messages: 14
Registered: January 2011
Junior Member
Hi All,

I upgraded my XText on eclipse from 2.2.1 to 2.3. After which I had to do quite a number of changes in my code to adapt to the new framework. I could some how resolve most of them but was not able to resolve one particular error

Couldn't resolve reference to JvmIdentifiableElement 'generateStub'.

I see in my old code that generateStub in my *.mwe2 file was a reference to method

public boolean setGenerateStub(final boolean generateStub) in SerialzerFragment of XText generator, even though the updated xtext has the same class in the same package and also has the same method but the reference is not resolved Sad.

Any help in this regard would be very much helpful and appreciable. Thanks in advance.

Please let me know if much details required.
Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899149 is a reply to message #899041] Mon, 30 July 2012 16:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

this should work. looks like your installation/setup is corrupt.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899179 is a reply to message #899041] Mon, 30 July 2012 21:23 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
I've had the same when I upgraded to 2.3.0.
Unfortunately, I do not recall what exactly made it disappear.
I suppose it could be related with the fact that Xtend has been split of Xtext - so try to make sure that you have the Xtend SDK 2.3.0 installed in your IDE - the SerializerFragment is resolved as an Xtend class inside org.eclipse.xtext.generator_2.3.0; this class has a setGenerateStub method, so everything looks fine.
Could you check where your SerializerFragment resolves to (the version of the bundle as well as if it is a java class or an xtend class)?

[Updated on: Mon, 30 July 2012 21:25]

Report message to a moderator

Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899239 is a reply to message #899041] Tue, 31 July 2012 08:08 Go to previous messageGo to next message
Sreekanth SC is currently offline Sreekanth SCFriend
Messages: 14
Registered: January 2011
Junior Member
Thanks for the reply. I guess the 2.3.0 installation of XText was improper. Now I got rid of those errors with a fresh installation however now I have another kind of error

"This expression is not allowed in this context, since it doesn't cause any side effects.".

I did some searching of the same in the bug list and found out that new version complains as I mentioned above. Here is the link

https://bugs.eclipse.org/bugs/show_bug.cgi?id=381770

I see that the bug is resolved, but I could not get the solution. Thanks in advance.
Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899989 is a reply to message #899239] Fri, 03 August 2012 11:01 Go to previous messageGo to next message
Sreekanth SC is currently offline Sreekanth SCFriend
Messages: 14
Registered: January 2011
Junior Member
Hi All,

I am awaiting some positive response for the above error. Please let me know. Thanks Smile
Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899991 is a reply to message #899989] Fri, 03 August 2012 11:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

there are several bugs around this. since you did not come up with a specific example it is hard to tell if your problem is already fixed. there is e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=382208
if you do special things in your Xtend file.

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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899994 is a reply to message #899991] Fri, 03 August 2012 11:30 Go to previous messageGo to next message
Sreekanth SC is currently offline Sreekanth SCFriend
Messages: 14
Registered: January 2011
Junior Member
This is a sample case from my workspace

def dispatch create eReference : EcoreFactory::eINSTANCE.createEReference mapProperty(MyProperty myproperty) {
eReference.setPropertyAttributes(...)
eReference.containment = false
eReference
}

Basically, I am returning an eReference in this xtend method, for which my update of XText and Xtend is crying telling me that "This expression is not allowed in this context, since it doesn't cause any side effects."

Hope this helps to better understand my usecase? Thanks Smile
Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #899995 is a reply to message #899994] Fri, 03 August 2012 11:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

this is 100% the bug i have posted (that is NOT fixed). the workaround is to split dispatch and create

def create eReference : EcoreFactory::eINSTANCE.createEReference mapPropertyInternal(MyProperty myproperty) {
eReference.setPropertyAttributes(...)
eReference.containment = false
eReference
}

def dispatch mapProperty(MyProperty myproperty) {
mapPropertyInternal(myproperty)
}


~Christian

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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #900002 is a reply to message #899995] Fri, 03 August 2012 11:54 Go to previous messageGo to next message
Sreekanth SC is currently offline Sreekanth SCFriend
Messages: 14
Registered: January 2011
Junior Member
Hi Christian,

Thanks for the reply, but even with the changed implementation as you mentioned, I still get the same error. Sad. Phew!


Re: Couldn't resolve reference to JvmIdentifiableElement 'generateStub'. [message #900005 is a reply to message #900002] Fri, 03 August 2012 12:06 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

does it work to leave out the last eReference statement/expression?

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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Terminal Rule Error
Next Topic:Using variables with predefined functions
Goto Forum:
  


Current Time: Tue Mar 19 09:06:00 GMT 2024

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

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

Back to the top