[Sculptor 3] Upgraded to Xtext 2.4.0 and Tycho 0.17.0

268 views
Skip to first unread message

Torsten Juergeleit

unread,
Mar 26, 2013, 8:59:08 PM3/26/13
to fornax-...@googlegroups.com
In the parent POM Xtext 2.4.0 and Tycho 0.17.0 are configured now.

The new Xtend Maven compiler reports issues not detected in the Xtend Eclipse editor / compiler, e.g. usage of reserved keywords (like enum, extends, class, ...) as variables or properties or errors like "private def" and "def override". It's really annoying that the Eclipse editor / compiler isn't complaining on these obvious errors.

The new Xtext generator is able to generate Xtend stubs instead of Java stubs. This is activated by using "var generateXtendStub = true" in the MWE2 config. Most of the existing Java stubs are migrated to Xtend now.

To use Xtext 2.4.0 in your own Maven build the local Eclipse p2 mirror has to be updated via "mvn -Pmirror initialize". To use Xtext 2.4.0 in your Eclipse IDE the corresponding Eclipse plugins have to be installed from the Xtext update site or from the updated local Eclipse p2 mirror.

/Torsten

Pavel Tavoda

unread,
Mar 27, 2013, 3:49:50 AM3/27/13
to fornax-...@googlegroups.com
Thank you for update, I will fix this errors.

Pavel Tavoda

unread,
Mar 27, 2013, 6:14:39 AM3/27/13
to fornax-...@googlegroups.com
Sculptor RunnerTest is failing from maven. Inside Eclipse is running fine. Any idea why?

______________________________________________________________________________
Running org.sculptor.generator.SculptorRunnerTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.153 sec <<< FAILURE!
testRun(org.sculptor.generator.SculptorRunnerTest)  Time elapsed: 0.117 sec  <<< ERROR!
com.google.inject.CreationException: Guice creation errors:

1) Error injecting method, java.lang.ExceptionInInitializerError
  at org.eclipse.xtext.validation.AbstractInjectableValidator.register(AbstractInjectableValidator.java:44)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)
  while locating org.eclipse.emf.mwe2.language.validation.Mwe2JavaValidator

1 error
at org.eclipse.emf.mwe2.language.mwe2.impl.Mwe2PackageImpl.initializePackageContents(Mwe2PackageImpl.java:669)
at org.eclipse.emf.mwe2.language.mwe2.impl.Mwe2PackageImpl.init(Mwe2PackageImpl.java:195)
at org.eclipse.emf.mwe2.language.mwe2.Mwe2Package.<clinit>(Mwe2Package.java:60)
at org.eclipse.emf.mwe2.language.validation.Mwe2JavaValidator.getEPackages(Mwe2JavaValidator.java:363)
at org.eclipse.xtext.validation.AbstractInjectableValidator.register(AbstractInjectableValidator.java:44)
at org.eclipse.xtext.validation.AbstractInjectableValidator$$FastClassByGuice$$2999770a.invoke(<generated>)
at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:56)
at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:90)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:204)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:198)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:198)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:179)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.sculptor.generator.SculptorRunner$1.createInjector(SculptorRunner.java:49)
at org.eclipse.emf.mwe2.language.Mwe2StandaloneSetupGenerated.createInjectorAndDoEMFRegistration(Mwe2StandaloneSetupGenerated.java:28)
at org.sculptor.generator.SculptorRunner.run(SculptorRunner.java:46)
at org.sculptor.generator.SculptorRunnerTest.testRun(SculptorRunnerTest.java:28)

testRunInvalid(org.sculptor.generator.SculptorRunnerTest)  Time elapsed: 0.036 sec  <<< ERROR!
com.google.inject.CreationException: Guice creation errors:

1) Error injecting method, java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.emf.mwe2.language.mwe2.Mwe2Package
  at org.eclipse.xtext.validation.AbstractInjectableValidator.register(AbstractInjectableValidator.java:44)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:55)
  while locating org.eclipse.emf.mwe2.language.validation.Mwe2JavaValidator

1 error
at org.eclipse.emf.mwe2.language.validation.Mwe2JavaValidator.getEPackages(Mwe2JavaValidator.java:363)
at org.eclipse.xtext.validation.AbstractInjectableValidator.register(AbstractInjectableValidator.java:44)
at org.eclipse.xtext.validation.AbstractInjectableValidator$$FastClassByGuice$$2999770a.invoke(<generated>)
at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:56)
at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:90)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:204)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:198)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:198)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:179)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.sculptor.generator.SculptorRunner$1.createInjector(SculptorRunner.java:49)
at org.eclipse.emf.mwe2.language.Mwe2StandaloneSetupGenerated.createInjectorAndDoEMFRegistration(Mwe2StandaloneSetupGenerated.java:28)
at org.sculptor.generator.SculptorRunner.run(SculptorRunner.java:46)
at org.sculptor.generator.SculptorRunnerTest.testRunInvalid(SculptorRunnerTest.java:33)


On Wednesday, March 27, 2013 1:59:08 AM UTC+1, Torsten Juergeleit wrote:

Torsten Juergeleit

unread,
Mar 27, 2013, 12:28:44 PM3/27/13
to fornax-...@googlegroups.com
Sculptor RunnerTest is failing from maven. Inside Eclipse is running fine. Any idea why?

This seems to be a side-effect of surefires classloader magic together with MWE2s naive solution of creating a classpath for the resource set from the Java system property "java.class.path". We need a valid classpath for SculptorRunner(Test).

After disabling the LibraryTransformationTest the SculptorRunnerTest is working again. Strange.

/Torsten

Torsten Juergeleit

unread,
Mar 27, 2013, 1:52:51 PM3/27/13
to fornax-...@googlegroups.com
 After fiddling around with surefires fork options my best guess is to run each unit test class (which uses Guice injector magic) in a newly forked JVM.

/Torsten

Ron Smith

unread,
Mar 27, 2013, 8:28:06 PM3/27/13
to fornax-...@googlegroups.com
I'm getting the following error with the latest - anyone else getting it?

[INFO] --- fornax-oaw-m2-plugin:3.4.0:run-workflow (default) @ org.sculptor.dsl ---
[INFO] Fornax Model Workflow Maven2 Plugin V3.4.0
[INFO] Executing workflow in forked mode.
[ERROR] 1    ERROR Mwe2Launcher       - [XtextLinkingDiagnostic: null:87 Couldn't resolve reference to JvmType 'validation.ValidatorFragment'., XtextLinkingDiagnostic: null:88 Couldn't resolve reference to JvmIdentifiableElement 'composedCheck'., XtextLinkingDiagnostic: null:121 Couldn't resolve reference to JvmType 'contentAssist.ContentAssistFragment'.]
[INFO] java.lang.IllegalStateException: [XtextLinkingDiagnostic: null:87 Couldn't resolve reference to JvmType 'validation.ValidatorFragment'., XtextLinkingDiagnostic: null:88 Couldn't resolve reference to JvmIdentifiableElement 'composedCheck'., XtextLinkingDiagnostic: null:121 Couldn't resolve reference to JvmType 'contentAssist.ContentAssistFragment'.]
[ERROR]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:88)
[ERROR]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
[ERROR]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
[ERROR]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
[ERROR]     at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)


I tried a fresh clone from git & build, same results.  I didn't re-mirror p2 though.

travis-ci builds are successful so it may be something environmental.

Ron

Karsten Thoms

unread,
Mar 28, 2013, 4:49:14 AM3/28/13
to fornax-...@googlegroups.com
Notice that "contentAssist.ContentAssistFragment" is a short name. Check that the fragment in the MWE file that it is fully qualified.

----- Ursprüngliche Mail -----
Von: "Ron Smith" <rsmit...@gmail.com>
An: fornax-...@googlegroups.com
Gesendet: Donnerstag, 28. März 2013 01:28:06
Betreff: Re: [Sculptor 3] Upgraded to Xtext 2.4.0 and Tycho 0.17.0
--
You received this message because you are subscribed to the Google Groups "Fornax-Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fornax-platfo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out .


Ron Smith

unread,
Mar 30, 2013, 10:18:15 AM3/30/13
to fornax-...@googlegroups.com
I changed it to fully qualified but still had the issue.  It was able to resolve the class in Eclipse, but not Maven.

It ended up being an issue of needing to update the Eclipse p2 mirror.  I was using 'mvn initialize' but needed to activate the mirror profile 'mvn initialize -Pmirror'.

The generator build was trying to pull in a non-existent 2.3.1 version of org.eclipse.xtext.generator but not complaining about not finding it.  After the mirror update, it correctly pulled in the 2.4.0 version.

Thanks
Ron
Reply all
Reply to author
Forward
0 new messages