Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext / Xtend 2.20 release
Xtext / Xtend 2.20 release [message #1817900] Mon, 02 December 2019 15:17 Go to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hello all,

Xtext / Xtend 2.20 have been released.

You can find the release notes here
https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2019/12/03/version-2-20-0
https://www.eclipse.org/xtend/releasenotes.html#/releasenotes/2019/12/03/version-2-20-0

You can find the release on the xtext update site (https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.20.0) and in the download area (https://www.eclipse.org/modeling/tmf/downloads/index.php?project=xtext&showAll=1&showMax=5&sortBy=)

The artifacts should be available via maven central and on the Eclipse Marketplace. soon.

Happy xtexting
~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 02 December 2019 15:29]

Report message to a moderator

Re: Xtext / Xtend 2.20 release [message #1817942 is a reply to message #1817900] Tue, 03 December 2019 12:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
I tried switching the target platform for Xcore's Tycho build to use this release, but all my tests fail to run:
Running org.eclipse.emf.test.ecore.xcore.ecore.XcoreEcoreTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.043 sec <<< FAILURE! - in org.eclipse.emf.test.ecore.xcore.ecore.XcoreEcoreTest
org.eclipse.emf.test.ecore.xcore.ecore.XcoreEcoreTest  Time elapsed: 0.04 sec  <<< ERROR!
java.lang.NoClassDefFoundError: org/eclipse/emf/mwe2/runtime/workflow/IWorkflowComponent
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:514)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:294)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:717)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:640)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:608)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:588)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:567)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:472)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:294)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:717)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:640)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:608)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:588)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:567)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:346)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:398)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:476)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.xtext.ecore.EcoreSupportStandaloneSetup.<init>(EcoreSupportStandaloneSetup.java:23)
	at org.eclipse.xtext.ecore.EcoreSupportStandaloneSetup.setup(EcoreSupportStandaloneSetup.java:19)
	at org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup.createInjectorAndDoEMFRegistration(XcoreStandaloneSetup.java:69)
	at org.eclipse.emf.ecore.xcore.XcoreInjectorProvider.internalCreateInjector(XcoreInjectorProvider.java:37)
	at org.eclipse.emf.test.ecore.xcore.XcoreStandaloneInjectorProvider.internalCreateInjector(XcoreStandaloneInjectorProvider.java:44)
	at org.eclipse.emf.test.ecore.xcore.XcoreStandaloneInjectorProvider.getInjector(XcoreStandaloneInjectorProvider.java:31)
	at org.eclipse.emf.test.ecore.xcore.legacy_xpect_runner.ParameterizedXtextRunner.getChildren(ParameterizedXtextRunner.java:350)
	at org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:426)
	at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:351)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:359)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
Do you have any idea what might have changed in 2.20 that could lead to this problem?

These same tests run when launched as a normal JUnit test in the IDE.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Xtext / Xtend 2.20 release [message #1817943 is a reply to message #1817942] Tue, 03 December 2019 13:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Yes there were some required bundles
Removed. Regarding the old generator

P2 might be buggy with that regard



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 03 December 2019 13:05]

Report message to a moderator

Re: Xtext / Xtend 2.20 release [message #1817967 is a reply to message #1817943] Tue, 03 December 2019 17:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Can you please be more specific? I.e., if a bundle is required how can it be removed? Which bundles are removed? From where were they removed? How does this removal relate to "the old generator"? Is there anything I can do to the Xcore code to make these tests run again? I.e., explicitly add the removed thing somewhere?

Clearly I can't consume 2.20 if I can't run my tests, so I will need to continue to use 2.19 until I can find some way to get the tests to run. Note that this test suite runs as a plain JUnit Test and as a JUnit Plug-in Test launched from the development IDE so there appears to be no p2 bug...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Xtext / Xtend 2.20 release [message #1817969 is a reply to message #1817967] Tue, 03 December 2019 17:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
There were some Xtext bundles that required org.eclipse.xtext.generator
But no longer do

Somewhere in your code you use
IWorkflow

Which is in https://github.com/eclipse/mwe/tree/master/plugins/org.eclipse.emf.mwe2.runtime/src/org/eclipse/emf/mwe2/runtime/workflow

Thus I wonder why that was working if you don't have
A dependency to it right now

Can't you simply add the bundle that you require


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext / Xtend 2.20 release [message #1817973 is a reply to message #1817969] Tue, 03 December 2019 17:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Can you please create a github issue
I don't know when I can look into it

I don't see which class uses iworkflowcomponent


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 03 December 2019 17:43]

Report message to a moderator

Re: Xtext / Xtend 2.20 release [message #1817974 is a reply to message #1817973] Tue, 03 December 2019 17:58 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Does it help if you add a dependency to 'org.eclipse.emf.mwe2.runtime' in the plugin that defines the XcoreStandaloneSetup or in the test plugin?
Re: Xtext / Xtend 2.20 release [message #1817975 is a reply to message #1817974] Tue, 03 December 2019 18:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

https://bugs.eclipse.org/bugs/show_bug.cgi?id=553392 might be helpful. I had to add an org.eclipse.emf.mwe.core dependency.

Regards

Ed Willink
Re: Xtext / Xtend 2.20 release [message #1817984 is a reply to message #1817975] Tue, 03 December 2019 21:37 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
It appears harder to reproduce the issue than I initially thought. I used a freshly oomphed emf / xcore / xsd workspace and tried to run the test from Eclipse. It was green as JUnit and as JUnit plugin test.
I can confirm though that the mvn build fails. Investigating.
Re: Xtext / Xtend 2.20 release [message #1817986 is a reply to message #1817984] Tue, 03 December 2019 22:51 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
I don't know why it fails form tycho but succeeds when run from within Eclipse. What helps for tycho is to add a (redundant) mandatory dependency from emf.ecore.xcore to org.eclipse.emf.mwe.core. I can't tell why the optional re-export from xtext doesn't work. But with that new require bundle entry, the tests became green.
Re: Xtext / Xtend 2.20 release [message #1817996 is a reply to message #1817986] Wed, 04 December 2019 05:47 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
I wonder if this change causes this
https://github.com/eclipse/xtext-extras/commit/cad0bab5bab686cb60e8336eaa4a83b7d609eaf6#diff-68bb570827967f8bb5d9589905a07afb
Or at least made it accidentially working in older versions

The optional mwe dep in org.eclipse.xtext is non greedy whilst it was in common types.
Thus Tycho might have pulled it before but no longer does
But then there should have been a problem if somebody uses abstract generic resource support / ecore support before but does not use Xbase


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext / Xtend 2.20 release [message #1818000 is a reply to message #1817986] Wed, 04 December 2019 06:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Sebastian Zarnekow wrote on Tue, 03 December 2019 17:51
I don't know why it fails form tycho but succeeds when run from within Eclipse.


On Eclipse you have all plugins from the target platform defined for the build.

On Tycho you have all plugins from the target platform defined for the test.

The former picks up extra goodies that are referenced by build-time-only plugins.

Regards

Ed Willink
Re: Xtext / Xtend 2.20 release [message #1818004 is a reply to message #1818000] Wed, 04 December 2019 06:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Yes. So it was broken all the time and just worked cause mwe was pulled over another path

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext / Xtend 2.20 release [message #1818005 is a reply to message #1818000] Wed, 04 December 2019 06:41 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Christian,

Yes, I think the requirements in Xtext should really be optional greedy, not just optional. I could fix the problem by adding this to the xcore.test manifest:

org.eclipse.emf.mwe.core;bundle-version="[1.0.0,2.0.0)";resolution:=optional;x-installation:=greedy,

I mostly did it this way just to see that optional greedy works with Tycho, and to avoid any changes in the bundles that I actually redistribute. Note that this back's up what Ed W is saying. I.e., even though I have an error loading a class in org.eclipse.emf.mwe.runtime, ensuring that org.eclipse.emf.mwe.core is in the surefire launch is needed to actually fix the problem. And this suggests that like a p2 install, unless there is a non-optional requirement or some optional greedy requirement, the bundle will not end up in the available bundles of the launch.

THANKS EVERYONE for helping me fix this problem. YOU GUYS ROCK!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Xtext / Xtend 2.20 release [message #1818278 is a reply to message #1818005] Wed, 11 December 2019 10:58 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I had exactly the same problem with Edelta, https://github.com/LorenzoBettini/edelta, where I'm using Xbase and xtext.ecore support. My custom injector provider in tests relies on EcoreSupport and I was experiencing failures of the shape

java.lang.NoClassDefFoundError: org/eclipse/xtext/ecore/EcoreSupport


when running tests from Maven Tycho (everything worked correctly from Eclipse, even when running using JUnit Plug-in test). Luckily, some tests failed with a different NCDFE:

java.lang.NoClassDefFoundError: org/eclipse/emf/mwe2/runtime/workflow/IWorkflowComponent
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent cannot be found by org.eclipse.xtext_2.20.0.v20191202-0915


which led me to this post.

In my case this non greedy dep in the .tests project solved my issue:

org.eclipse.emf.mwe.core;bundle-version="[1.0.0,2.0.0)";resolution:=optional


Ed Merks, is "x-installation:=greedy" actually required in your case?

cheers
Lorenzo


Re: Xtext / Xtend 2.20 release [message #1818281 is a reply to message #1818278] Wed, 11 December 2019 12:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I think that the whole problem is that the dependency is not optional.

As a consequence of the generator refactoring clients have lost a 'free' dependency that clients must now provide explicitly.

It may be that further consideration of that refactoring might identify why org.eclipse.xtext has any mwe dependencies at all.

Regards

Ed Willink
Re: Xtext / Xtend 2.20 release [message #1818293 is a reply to message #1818281] Wed, 11 December 2019 16:07 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
there are some workflow components inside org.eclipse.xtext for historical reasons.
and there is some mixed stuff like AbstractGenericResourceSupport which is a workflow component as well
and thus EcoreSupport is a Worlflow component too.

of course if you dont use them you wont need the dependency
this is why its optional.



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:MWE2 code generation is different between Eclipse/Maven
Next Topic:Reduce resource consumption in project indexing
Goto Forum:
  


Current Time: Fri Apr 19 11:17:35 GMT 2024

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

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

Back to the top