Acceleo only works the first time [message #909604] |
Fri, 07 September 2012 12:02 |
Carlos André Messages: 2 Registered: September 2012 |
Junior Member |
|
|
Hey,
I'm trying to generate some C++ code using Acceleo in conjunction with ATL.
For some strange reason, my transformation works perfectly at first time, but any further attempts to do it again fail always, forcing me to restart eclipse.
I'm using the latest version of Acceleo (3.2.2) and ATL 3.2.1.
This is the way I'm using Acceleo:
try {
File modelFile = getOriginalEmxModelFile();
File outputFolder = new File(getOutputFolder(), MGC_OUTPUT_FOLDER_NAME);
URI modelURI = URI.createPlatformResourceURI(modelFile.getAbsolutePath(), true);
GenerateMgcCpp gen0 = new GenerateMgcCpp(modelURI, outputFolder, new ArrayList<String>());
monitor.worked(1);
gen0.doGenerate(BasicMonitor.toMonitor(monitor));
monitor.worked(1);
} catch (Exception e) {
return new Status(IStatus.ERROR, MgcActivator.PLUGIN_ID,
e.getMessage(), e);
}
finally {
monitor.done();
System.gc();
}
And this is the error I get after trying to run this transformation again:
VM Exception thrown by ATL Launcher: org.eclipse.m2m.atl.engine.emfvm.VMException
Java Stack:
org.eclipse.m2m.atl.engine.emfvm.VMException
at org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.finalizeModel(Unknown Source)
at org.eclipse.m2m.atl.engine.emfvm.lib.ExecEnv.terminated(Unknown Source)
at org.eclipse.m2m.atl.engine.emfvm.ASM.run(Unknown Source)
at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(Unknown Source)
at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMUILauncher.launch(Unknown Source)
at org.eclipse.m2m.atl.core.service.LauncherService.launch(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.applyDelayedInvocations(Unknown Source)
... 9 more
Caused by: java.lang.IllegalArgumentException: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@1d641d64 (name: Documentation, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false)
at org.eclipse.uml2.uml.internal.operations.ElementOperations.applyStereotype(Unknown Source)
at org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereotype(Unknown Source)
... 13 more
I basically use ATL to generate an intermediate model and then I run Acceleo on it.
All ATL transformations were pretty stable until now, when I started to use Acceleo.
Does anyone have any idea what might be causing this?
I'm kind of new to this type of technologies, maybe I'm doing something completely wrong.
Thanks,
Carlos
|
|
|
Re: Acceleo only works the first time [message #909618 is a reply to message #909604] |
Fri, 07 September 2012 12:29 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
[Acceleo 3.2.2 is not the most recent; I strongly recommend moving to
3.3; but I doubt that is your problem]
If you need to restart Eclipse then it is very likely that you have
corrupted a global registry.
Tou might find org.eclipse.xtext.junit4.GlobalRegistries useful to to
take a copy of important registries before a transformation so that
you can see what has changed.
Regards
Ed Willink
On 07/09/2012 13:02, Carlos André wrote:
> Hey,
>
> I'm trying to generate some C++ code using Acceleo in conjunction with
> ATL.
> For some strange reason, my transformation works perfectly at first
> time, but any further attempts to do it again fail always, forcing me
> to restart eclipse.
> I'm using the latest version of Acceleo (3.2.2) and ATL 3.2.1.
>
> This is the way I'm using Acceleo:
>
>
> try {
>
> File modelFile = getOriginalEmxModelFile();
> File outputFolder = new File(getOutputFolder(),
> MGC_OUTPUT_FOLDER_NAME);
>
> URI modelURI =
> URI.createPlatformResourceURI(modelFile.getAbsolutePath(), true);
>
> GenerateMgcCpp gen0 = new GenerateMgcCpp(modelURI,
> outputFolder, new ArrayList<String>());
> monitor.worked(1);
> gen0.doGenerate(BasicMonitor.toMonitor(monitor));
> monitor.worked(1);
>
> } catch (Exception e) {
> return new Status(IStatus.ERROR, MgcActivator.PLUGIN_ID,
> e.getMessage(), e);
> }
>
> finally {
> monitor.done();
> System.gc();
> }
>
>
>
> And this is the error I get after trying to run this transformation
> again:
> VM Exception thrown by ATL Launcher:
> org.eclipse.m2m.atl.engine.emfvm.VMException
> Java Stack:
> org.eclipse.m2m.atl.engine.emfvm.VMException
> at
> org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.finalizeModel(Unknown
> Source)
> at org.eclipse.m2m.atl.engine.emfvm.lib.ExecEnv.terminated(Unknown
> Source)
> at org.eclipse.m2m.atl.engine.emfvm.ASM.run(Unknown Source)
> at
> org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(Unknown
> Source)
> at
> org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMUILauncher.launch(Unknown
> Source)
> at org.eclipse.m2m.atl.core.service.LauncherService.launch(Unknown
> Source)
> at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.m2m.atl.engine.emfvm.adapter.UML2ModelAdapter.applyDelayedInvocations(Unknown
> Source)
> ... 9 more
> Caused by: java.lang.IllegalArgumentException:
> mailto:org.eclipse.uml2.uml.internal.impl.StereotypeImpl@1d641d64
> (name: Documentation, visibility: <unset>) (isLeaf: false, isAbstract:
> false) (isActive: false)
> at
> org.eclipse.uml2.uml.internal.operations.ElementOperations.applyStereotype(Unknown
> Source)
> at
> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereotype(Unknown
> Source)
> ... 13 more
>
> I basically use ATL to generate an intermediate model and then I run
> Acceleo on it.
> All ATL transformations were pretty stable until now, when I started
> to use Acceleo.
> Does anyone have any idea what might be causing this?
> I'm kind of new to this type of technologies, maybe I'm doing
> something completely wrong.
>
> Thanks,
> Carlos
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03689 seconds