Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Generation no longer works after upgrade to Eclipse 4.3
[Acceleo] Generation no longer works after upgrade to Eclipse 4.3 [message #1233444] Sun, 19 January 2014 12:09 Go to next message
Luís de Sousa is currently offline Luís de Sousa
Messages: 133
Registered: July 2009
Senior Member
Hello everyone. I upgraded Eclipse to the Kepler version and since then all Acceleo transformations I developed with previous versions stopped working. I always get the same error message:

The generation failed to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates. 
The problem may be caused by a problem with the registration of your metamodel, please see the method named "registerPackages" in the Java launcher of your generator. It could also come from a missing [comment @main/] 
in the template used as the entry point of the generation. 


The models I'm using contain the necessary elements and the main tag is where it should be. That leaves the registerPackages method, but I do not know what should I change relative to Acceleo 3.3.1.

Any help is welcome. Thanks.
Re: [Acceleo] Generation no longer works after upgrade to Eclipse 4.3 [message #1233448 is a reply to message #1233444] Sun, 19 January 2014 12:22 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de Sousa
Messages: 133
Registered: July 2009
Senior Member
As I work with my Acceleo projects I'm getting repetitive errors and exceptions that might explain why Acceleo isn't working anymore. They are of two kinds:

Message
An error has occurred during the loading of 'jar:file:/usr/local/eclipse.kepler/plugins/org.eclipse.acceleo.ide.ui_3.4.1.201309031307.jar!/org/eclipse/acceleo/internal/ide/ui/generators/buildAcceleo.emtl'.
Message: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1c829816 (eProxyURI: platform:/resource/DSL3S/profile/ecore.ecore#//EObject eClass: org.eclipse.emf.ecore.impl.EClassImpl@cfa1b1a (name: EClass) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (jar:file:/usr/local/eclipse.kepler/plugins/org.eclipse.acceleo.ide.ui_3.4.1.201309031307.jar!/org/eclipse/acceleo/internal/ide/ui/generators/buildAcceleo.emtl, 138, 92)
Location: jar:file:/usr/local/eclipse.kepler/plugins/org.eclipse.acceleo.ide.ui_3.4.1.201309031307.jar!/org/eclipse/acceleo/internal/ide/ui/generators/buildAcceleo.emtl at line 138 and column 92 

Exception Stack Trace
An exception stack trace is not available.

Session Data
eclipse.buildId=4.3.0.M20130911-1000
java.version=1.7.0_17
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Command-line arguments:  -data /media/lads/Data/users/lads/Trabalho/Eclipse/Workspace.DSL3S -os linux -ws gtk -arch x86_64



Message
Errors running builder 'Acceleo Builder' on project 'DSL3S'.

Exception Stack Trace
java.lang.NullPointerException
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:731)
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:432)
	at org.eclipse.acceleo.internal.ide.ui.generators.AcceleoUIGenerator.generate(AcceleoUIGenerator.java:479)
	at org.eclipse.acceleo.internal.ide.ui.generators.AcceleoUIGenerator.generateBuildAcceleo(AcceleoUIGenerator.java:223)
	at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.generateAcceleoBuildFile(AcceleoBuilder.java:632)
	at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.build(AcceleoBuilder.java:246)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Session Data
eclipse.buildId=4.3.0.M20130911-1000
java.version=1.7.0_17
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Command-line arguments:  -data /media/lads/Data/users/lads/Trabalho/Eclipse/Workspace.DSL3S -os linux -ws gtk -arch x86_64
Re: [Acceleo] Generation no longer works after upgrade to Eclipse 4.3 [message #1233919 is a reply to message #1233448] Mon, 20 January 2014 16:03 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

What is the input meta-models of your generator? How are you using your generators: already packaged and deployed as plugins, Acceleo projects in your workspace, something else?.

This seems a bit odd in my mind:
Quote:
Message: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1c829816 (eProxyURI: platform:/resource/DSL3S/profile/ecore.ecore#//EObject eClass: org.eclipse.emf.ecore.impl.EClassImpl@cfa1b1a (name: EClass) (instanceClassName: null) (abstract: false, interface: false))' is not legal.

What is this ecore.ecore file? What is its NsUri ?Since Acceleo will try to register your metamodel in our own dedicated package registry, that seems like the kind of thing that could replace the original Ecore.ecore meta-model in our own package registry and then you would have countless of problems with Acceleo.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks



Re: [Acceleo] Generation no longer works after upgrade to Eclipse 4.3 [message #1235919 is a reply to message #1233919] Sat, 25 January 2014 12:44 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de Sousa
Messages: 133
Registered: July 2009
Senior Member
Hi Stephane, thank you for the feedback. I had several .ecore files along with the profile I was feeding to the Acceleo templates. I had to generate them in order to try the profile with Sirius, read here for details.

I thus deleted all the .ecore files, but my templates still do not run (see the exception below).

I have both templates and profile in a project in my workspace.

Message
An internal error occurred during: "Launching Main".

Exception Stack Trace
org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the first parameter of the main template named 'mainClass' is a proxy.
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:566)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:194)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:159)
	at dsl3s.templates.Main.doGenerate(Main.java:202)
	at org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoLaunchOperation.run(AcceleoLaunchOperation.java:149)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2327)
	at org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoPluginLaunchingStrategy.launch(AcceleoPluginLaunchingStrategy.java:259)
	at org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoPluginLaunchingStrategy.launch(AcceleoPluginLaunchingStrategy.java:161)
	at org.eclipse.acceleo.internal.ide.ui.launching.AcceleoLaunchDelegate.launch(AcceleoLaunchDelegate.java:51)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Session Data
eclipse.buildId=4.3.0.M20130911-1000
java.version=1.7.0_17
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Command-line arguments:  -os linux -ws gtk -arch x86_64

Re: [Acceleo] Generation no longer works after upgrade to Eclipse 4.3 [message #1237080 is a reply to message #1235919] Tue, 28 January 2014 15:15 Go to previous messageGo to next message
Luís de Sousa is currently offline Luís de Sousa
Messages: 133
Registered: July 2009
Senior Member
I found reports of this same problem (here and here), where the fix was simply to make sure Acceleo is using XMI based serialisation.

In my project serialisation was already set to XMI before the upgrade, thus this exception must have a different cause.

Thank you.
Re: [Acceleo] Generation no longer works after upgrade to Eclipse 4.3 [message #1248867 is a reply to message #1237080] Mon, 17 February 2014 13:48 Go to previous message
Luís de Sousa is currently offline Luís de Sousa
Messages: 133
Registered: July 2009
Senior Member
Weirdest thing: I deleted the project from the Workspace and imported it back from Git, now it works as it should. I suspect the update screwed up something with the Workspace.

Cheers.
Previous Topic:[Acceleo] Random order in UML for sequence of datatypes
Next Topic:[Acceleo] How to activate the "Acceleo Model To Text" context menu?
Goto Forum:
  


Current Time: Thu Aug 28 05:23:46 EDT 2014

Powered by FUDForum. Page generated in 0.01708 seconds