Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Acceleo generator in standalone mode
Acceleo generator in standalone mode [message #1386145] Fri, 13 June 2014 15:31 Go to next message
Daniel Tahin is currently offline Daniel TahinFriend
Messages: 27
Registered: July 2013
Junior Member
Hello,

i try to use the Acceleo generator outside of Eclipse (by calling java Generate from commandline), without any luck.
The following descriptions are also not working:
http://wiki.eclipse.org/Acceleo/FAQ#How_can_I_compile_my_mtl_files_in_a_standalone_environment.3F
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.acceleo.doc%2Fpages%2Freference%2Fstandalone.html

I'm trying to use Generate.java (that is automatially created in Eclispe). It compiles, but executing it, i get this error:

--------------------------------------------
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOException: Invalid signature for a binary EMF serialization
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:361)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:454)
at at.ac.wu.acceleo.nx.Generate.<init>(Generate.java:90)
at at.ac.wu.acceleo.nx.Generate.main(Generate.java:144)
Caused by: java.io.IOException: Invalid signature for a binary EMF serialization
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readSignature(BinaryResourceImpl.java:1996)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.<init>(BinaryResourceImpl.java:1959)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.createEObjectInputStream(BinaryResourceImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.doLoad(BinaryResourceImpl.java:263)
at org.eclipse.acceleo.model.mtl.resource.EMtlBinaryResourceImpl.doLoad(EMtlBinaryResourceImpl.java:83)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 5 more
--------------------------------------------

To execute it (run.bat), i specify all the jar files, found in the Eclipse\plugins folder (with C:\eclipse\plugins\*; in the classpath argument of Java).
The model i want to transform is sample2.ecore.
Generate.class is located in the package hierarchie: at.ac.wu.acceleo.nx
It is called with: java -classpath "C:\eclipse\plugins\*;.;" at.ac.wu.acceleo.nx.Generate "D:\acceleo\at.ac.wu.acceleo.nx\src\sample2.ecore" "D:/out"
(surprisingly Generate.class looks for generate.emtl and NOT for .mtl, like in Eclispe)

In Eclipse in Activator.java (function public void start(BundleContext context)) i write the content of 'context' in a file to figure out, how the generator is invoked...

Should i specify a parameter of Generate.class in standalone mode?

Thank you in advance for your help,
Daniel
  • Attachment: Activator.java
    (Size: 2.37KB, Downloaded 167 times)
  • Attachment: generate.emtl
    (Size: 1.69KB, Downloaded 146 times)
  • Attachment: compile.bat
    (Size: 0.81KB, Downloaded 122 times)
  • Attachment: run.bat
    (Size: 0.99KB, Downloaded 127 times)
  • Attachment: sample2.ecore
    (Size: 4.99KB, Downloaded 183 times)
Re: Acceleo generator in standalone mode [message #1386173 is a reply to message #1386145] Sat, 14 June 2014 05:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Please use the eclipse.modeling.m2t forum to ask questions about Acceleo.

On 13/06/2014 5:31 PM, Daniel Tahin wrote:
> Hello,
>
> i try to use the Acceleo generator outside of Eclipse (by calling java Generate from commandline), without any luck.
> The following descriptions are also not working:
> http://wiki.eclipse.org/Acceleo/FAQ#How_can_I_compile_my_mtl_files_in_a_standalone_environment.3F
> http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.acceleo.doc%2Fpages%2Freference%2Fstandalone.html
>
> I'm trying to use Generate.java (that is automatially created in Eclispe). It compiles, but executing it, i get this error:
>
> --------------------------------------------
> Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOException: Invalid signature for a binary EMF serialization
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
> at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:361)
> at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:454)
> at at.ac.wu.acceleo.nx.Generate.<init>(Generate.java:90)
> at at.ac.wu.acceleo.nx.Generate.main(Generate.java:144)
> Caused by: java.io.IOException: Invalid signature for a binary EMF serialization
> at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.readSignature(BinaryResourceImpl.java:1996)
> at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl$EObjectInputStream.<init>(BinaryResourceImpl.java:1959)
> at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.createEObjectInputStream(BinaryResourceImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl.doLoad(BinaryResourceImpl.java:263)
> at org.eclipse.acceleo.model.mtl.resource.EMtlBinaryResourceImpl.doLoad(EMtlBinaryResourceImpl.java:83)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
> ... 5 more
> --------------------------------------------
>
> To execute it (run.bat), i specify all the jar files, found in the Eclipse\plugins folder (with C:\eclipse\plugins\*; in the classpath argument of Java).
> The model i want to transform is sample2.ecore.
> Generate.class is located in the package hierarchie: at.ac.wu.acceleo.nx
> It is called with: java -classpath "C:\eclipse\plugins\*;.;" at.ac.wu.acceleo.nx.Generate "D:\acceleo\at.ac.wu.acceleo.nx\src\sample2.ecore" "D:/out"
> (surprisingly Generate.class looks for generate.emtl and NOT for .mtl, like in Eclispe)
>
> In Eclipse in Activator.java (function public void start(BundleContext context)) i write the content of 'context' in a file to figure out, how the generator is invoked...
>
> Should i specify a parameter of Generate.class in standalone mode?
>
> Thank you in advance for your help,
> Daniel
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Acceleo generator in standalone mode [message #1386184 is a reply to message #1386173] Sat, 14 June 2014 12:02 Go to previous message
Daniel Tahin is currently offline Daniel TahinFriend
Messages: 27
Registered: July 2013
Junior Member
Problem solved.
I forgot, that Acceleo requires .emtl and not .mtl files, because the .mtl files are compiled into .emtl.
Previous Topic:Extending models at runtime
Next Topic:[CDO/Hibernate] Query withing one resource
Goto Forum:
  


Current Time: Thu Apr 25 20:15:50 GMT 2024

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

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

Back to the top