Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » eclipse update broke my xtext
eclipse update broke my xtext [message #831282] Wed, 28 March 2012 17:52 Go to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Hi,
I recently updated my eclipse installation and this completely broke my XText/XTend installation.

The error I get is:
0 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - [XtextLinkingDiagnostic: null:52 Couldn't resolve reference to JvmIdentifiableElement 'generateStub'.]
java.lang.IllegalStateException: [XtextLinkingDiagnostic: null:52 Couldn't resolve reference to JvmIdentifiableElement 'generateStub'.]
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:83)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)


I tried to re-create the project from scratch and I discovered that creating a new XText project produces a slightly different structure, with a second .mwe2 file in the .generator package.

I tried porting to the new structure, but I face several issues I don't know how to solve.
First andforemost is my XXXXGenerator.xtend still fails badly (even after some editing) because it starts:

....
class SIDLGenerator implements IMultipleResourceGenerator {

@Inject extension IQualifiedNameProvider nameProvider
@Inject extension ISerializer serializer

override void doGenerate(Resource resource, IFileSystemAccess fsa) {
for(e: resource.allContents.toIterable.filter(typeof(IFace))) {
if (e.has_option("local")) {
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + ".h", e.local_header)
} else {
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + ".h", e.header)
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + "_stub.c", e.stub)
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + "_skel.c", e.skel)
}
}
}

override void doGenerate(ResourceSet rs, IFileSystemAccess fsa) {
val Map<IFace, String> m = new HashMap<IFace, String>();
val Iterable<IFace> entities = rs.resources.map(r|r.allContents.toIterable.filter(typeof(IFace))).flatten
for (e : entities) {
if (e.has_option("device")) {
m.put(e, e.option("device").sval)
}
}
for (s : m.values) {
val Set<IFace> set = new HashSet<IFace>()
for (p : m.entrySet) {
if (p.value.equals(s)) {
set.add(p.key)
}
}
fsa.generateFile(s.replaceAll("\\W", "_")+".h", set.header(s))
fsa.generateFile("server_"+s.replaceAll("\\W", "_")+".c", set.server(s))
fsa.generateFile("client_"+s.replaceAll("\\W", "_")+".c", set.client(s))
}
}
.....
This fails essentially because resource.allContents does not have a toIterable method (I don't know if this is the only error as it hides anything beyond it).

Could someone be so kind to tell me what should I change either to make my old project work or to fix the new one?

Thanks in advance.
Mauro
Re: eclipse update broke my xtext [message #831294 is a reply to message #831282] Wed, 28 March 2012 18:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Which of the Xtext versions do you use?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: eclipse update broke my xtext [message #831299 is a reply to message #831294] Wed, 28 March 2012 18:19 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
On 28/03/2012 20:09, Christian Dietrich wrote:
> Which of the Xtext versions do you use?
Current version is:

Xtext SDK 2.0.1.v201108020636 org.eclipse.xtext.sdk.feature.group Eclipse Modeling Project

Unfortunately I don't know what was the previous one.
Is there any way to find it?
Re: eclipse update broke my xtext [message #831306 is a reply to message #831299] Wed, 28 March 2012 18:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i am sure you downgraded your Xtext/Xtend. IteratorExtensions does not exist in 2.0.1

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: eclipse update broke my xtext [message #831316 is a reply to message #831306] Wed, 28 March 2012 18:51 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
On 28/03/2012 20:34, Christian Dietrich wrote:
> Hi,
>
> i am sure you downgraded your Xtext/Xtend. IteratorExtensions does not
> exist in 2.0.1
>
> ~Christian
Here comes my completely expanded Xtext plugin subtree directly copied from "Eclipse Installation Details"

I notice there is an "old" (1.1.1) version of Xpand/Xtend.
Can that be the problem?
I am checking now to see if there's an update for that.
If not what should I do? remove Xpand?

Xtext SDK 2.0.1.v201108020636 org.eclipse.xtext.sdk.feature.group Eclipse Modeling Project
Source for Xbase 2.0.1.v201108020636 org.eclipse.xtext.xbase.source.feature.group Eclipse Modeling Project
Source for Xtend2 SDK 2.0.1.v201108020636 org.eclipse.xtext.xtend2.sdk.source.feature.group Eclipse Modeling Project
Source for Xtext Examples 2.0.1.v201108020636 org.eclipse.xtext.examples.source.feature.group Eclipse Modeling Project
Source for Xtext Runtime 2.0.1.v201108020636 org.eclipse.xtext.runtime.source.feature.group Eclipse Modeling Project
Source for Xtext SDK 2.0.1.v201108020636 org.eclipse.xtext.sdk.source.feature.group Eclipse Modeling Project
Source for Xtext Documentation 2.0.1.v201108020636 org.eclipse.xtext.docs.source.feature.group Eclipse.org
Source for Xtext UI 2.0.1.v201108020636 org.eclipse.xtext.xtext.ui.source.feature.group Eclipse Modeling Project
Source for Xtext UI 2.0.1.v201108020636 org.eclipse.xtext.ui.source.feature.group Eclipse Modeling Project
Xbase 2.0.1.v201108020636 org.eclipse.xtext.xbase.feature.group Eclipse Modeling Project
Xtend2 SDK 2.0.1.v201108020636 org.eclipse.xtext.xtend2.sdk.feature.group Eclipse Modeling Project
Xtext Documentation 2.0.1.v201108020636 org.eclipse.xtext.docs.feature.group Eclipse.org
Xtext Examples 2.0.1.v201108020636 org.eclipse.xtext.examples.feature.group Eclipse Modeling Project
Xtext Runtime 2.0.1.v201108020636 org.eclipse.xtext.runtime.feature.group Eclipse Modeling Project
Xtext UI 2.0.1.v201108020636 org.eclipse.xtext.ui.feature.group Eclipse Modeling Project
MWE UI 1.1.1.v201108020506 org.eclipse.emf.mwe.ui.feature.group Eclipse Modeling Project
Xpand UI 1.1.1.v201108020519 org.eclipse.xpand.ui.feature.group Eclipse Modeling Project
Xpand 1.1.1.v201108020519 org.eclipse.xpand.feature.group Eclipse Modeling Project
Xtend 1.1.1.v201108020519 org.eclipse.xtend.feature.group Eclipse Modeling Project
Xtend Dependencies 1.1.1.v201108020519 org.eclipse.xtend.dependencies.feature.group Eclipse Modeling Project
Xtend EMF typesystem 1.1.1.v201108020519 org.eclipse.xtend.typesystem.emf.feature.group Eclipse Modeling Project
Xtend UI 1.1.1.v201108020519 org.eclipse.xtend.ui.feature.group Eclipse Modeling Project
Xtext UI 2.0.1.v201108020636 org.eclipse.xtext.xtext.ui.feature.group Eclipse Modeling Project
Re: eclipse update broke my xtext [message #831317 is a reply to message #831316] Wed, 28 March 2012 18:58 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
no this should not be a problem but why do you no simply update to the current version
http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: eclipse update broke my xtext [message #831901 is a reply to message #831317] Thu, 29 March 2012 13:59 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
On 28/03/2012 20:58, Christian Dietrich wrote:
> no this should not be a problem but why do you no simply update to the
> current version
> http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
Done.
Previously I just did a Help->Check for Updates.
Now I get the following notice for each and all the Xtext projects:


*ATTENTION*
It is recommended to use the ANTLR 3 parser generator (BSD licence - http://www.antlr.org/license.html).
Do you agree to download it (size 1MB) from 'http://download.itemis.com/antlr-generator-3.2.0.jar'? (type 'y' or 'n' and hit enter)y


Is it possible to instal that jar once and for all?

Now the system compiles and runs, but my code generator is not invoked when I save the resource.

I see no error. Neither on the primary eclipse instance (the eclipse where I'm running xtext) nor on target (the eclipse instance where I run my DSL editor).

I have a non-standard invocation because I want to generate code also for the whole bunch of DSLs and not only for the current one.
Did something change in that interface?

==================================================================
package com.softin.rpc;

import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.generator.IGenerator;

public interface IMultipleResourceGenerator extends IGenerator {
/**
* @param input - the input for which to generate resources
* @param fsa - file system access to be used to generate files
*/
public void doGenerate(ResourceSet input, IFileSystemAccess fsa);
}
==================================================================
/*
* generated by Xtext
*/
package com.softin.rpc.generator

import com.google.inject.Inject
import com.softin.rpc.IMultipleResourceGenerator
import com.softin.rpc.sIDL.Arg
import com.softin.rpc.sIDL.CDef
import com.softin.rpc.sIDL.Def
import com.softin.rpc.sIDL.FDef
import com.softin.rpc.sIDL.IFace
import com.softin.rpc.sIDL.TBody
import com.softin.rpc.sIDL.TDef
import com.softin.rpc.sIDL.Type
import com.softin.rpc.sIDL.XType
import com.softin.rpc.sIDL.XsType
import java.util.HashMap
import java.util.HashSet
import java.util.Map
import java.util.Set
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.emf.ecore.resource.ResourceSet
import org.eclipse.xtext.generator.IFileSystemAccess
import org.eclipse.xtext.naming.IQualifiedNameProvider
import org.eclipse.xtext.serializer.ISerializer

class SIDLGenerator implements IMultipleResourceGenerator {

@Inject extension IQualifiedNameProvider nameProvider
@Inject extension ISerializer serializer

override void doGenerate(Resource resource, IFileSystemAccess fsa) {
for(e: resource.allContents.toIterable.filter(typeof(IFace))) {
if (e.has_option("local")) {
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + ".h", e.local_header)
} else {
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + ".h", e.header)
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + "_stub.c", e.stub)
fsa.generateFile(e.fullyQualifiedName.toString.replace(".", "/") + "_skel.c", e.skel)
}
}
}

override void doGenerate(ResourceSet rs, IFileSystemAccess fsa) {
val Map<IFace, String> m = new HashMap<IFace, String>();
val Iterable<IFace> entities = rs.resources.map(r|r.allContents.toIterable.filter(typeof(IFace))).flatten
for (e : entities) {
if (e.has_option("device")) {
m.put(e, e.option("device").sval)
}
}
for (s : m.values) {
val Set<IFace> set = new HashSet<IFace>()
for (p : m.entrySet) {
if (p.value.equals(s)) {
set.add(p.key)
}
}
fsa.generateFile(s.replaceAll("\\W", "_")+".h", set.header(s))
fsa.generateFile("server_"+s.replaceAll("\\W", "_")+".c", set.server(s))
fsa.generateFile("client_"+s.replaceAll("\\W", "_")+".c", set.client(s))
}
}

def has_option(IFace f, String opt) {
if (f.options == null)
return false
for (o : f.options.options) {
if (o.name.equals(opt))
return true
}
return false
}

.... here continues the real generator, cut for brevity ...
==================================================================

What can I check, now?

TiA
Mauro
Re: eclipse update broke my xtext [message #831918 is a reply to message #831901] Thu, 29 March 2012 14:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
No I have no idea besides debugging the BuilderParticipant class .
And make sure the project has Xtext nature. The auto build is on etc


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: eclipse update broke my xtext [message #832466 is a reply to message #831918] Fri, 30 March 2012 07:18 Go to previous message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
On 29/03/2012 16:17, Christian Dietrich wrote:
> No I have no idea besides debugging the BuilderParticipant class . And
> make sure the project has Xtext nature. The auto build is on etc
I have an Xtext installation working, at last, but I had to manually remove a lot of 2.0.1 .jars still sitting in my eclipse/plugins directory.

Since I don't recall doing anything more than an eclipse indigo install (with lots of added packages, including CDT) and, much later a "Help->Check for Updates" with the default Update Sites, I strongly suggest to check if this is a more general problem or if I inadvertently did something wrong.

For the record:
Solution was:
- add http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ repository to the list (contains v2.2.0)
- update to the latest version
- manually delete all *_2.0.1.v20110802* files and directories
- rebuild all

Regards and MANY thanks for the assistance
Mauro
Previous Topic:Extending grammar - NoClassDefFoundError
Next Topic:How to access nested class defined in Java file?
Goto Forum:
  


Current Time: Tue Apr 23 13:24:22 GMT 2024

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

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

Back to the top