Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3.1] Problem launching transformation(The type of the first parameter of the main template named 'generateProject' is a proxy.)
[Acceleo 3.1] Problem launching transformation [message #704072] Thu, 28 July 2011 08:44 Go to next message
JM Gauthier is currently offline JM Gauthier
Messages: 25
Registered: June 2011
Junior Member
Hi,

I am planning to use Acceleo to generate a file from a .xmi model and as a noob, I got several troubles... This model is generated by ATL from a meta-model. I have done the "Quick start" and other tutorials...But no one talks about generating file from xmi file. Well, I have changed the Acceleo Compiler to XMI (properties of the project) but it doesn't change anything, and I got this error :

org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the first parameter of the main template named 'generateProject' is a proxy.
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:507)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:175)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:154)
...
...
etc


and this is my mtl file :

[comment encoding = UTF-8 /]
[module tdmodel('tdmodel')]


[template public generateProject(aProject : Project)]
[comment @main /]
[file(aProject.name, false,'UTF-8')]
Hello World!
[/file]
[/template]


To finish the .xmi file which is used as the input model for Acceleo :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tdmodel="tdmodel">
  <tdmodel:Project>
    <model>
      <model name="Model">
        <rootPackage name="rootPackage">
          <types xsi:type="tdmodel:Class" name="Student">
            <attributes name="age"/>
            <operations name="study"/>
          </types>
        </rootPackage>
      </model>
    </model>
  </tdmodel:Project>
  <tdmodel:ModelInstance/>
</xmi:XMI>


I don't know what to do, despite of intenses researches..Smile

Thanks!

[Updated on: Thu, 28 July 2011 10:25]

Report message to a moderator

Re: [Acceleo 3.1] Problem launching transformation [message #704113 is a reply to message #704072] Thu, 28 July 2011 09:32 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
I think that one element of answer is that 'tdmodel' meta model is unknown for Acceleo...

[Updated on: Thu, 28 July 2011 09:33]

Report message to a moderator

Re: [Acceleo 3.1] Problem launching transformation [message #704118 is a reply to message #704113] Thu, 28 July 2011 09:39 Go to previous messageGo to next message
JM Gauthier is currently offline JM Gauthier
Messages: 25
Registered: June 2011
Junior Member
Hi Sebastien,

Thanks for your response! Actually I have created the Acceleo project using the wizard. So I had registered the tdmodel.ecore with the ATL popmenu...I don't know if it's a good way but it is the only one I found to register meta model on the EMF Registry. Then I have chosen the meta model tdmodel in the wizard...I found tdmodel in the "Runtime Version" list of metamodel... I guess that the meta model tdmodel is know by Acceleo now, is it right ?

Thanks!
Re: [Acceleo 3.1] Problem launching transformation [message #707100 is a reply to message #704118] Mon, 01 August 2011 08:40 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1632
Registered: July 2009
Senior Member
Hi,

First things first, no, it is not a good way to register metamodels through the ATL popup menu. That being said, it is indeed the only way to do it since it is not something EMF recommends.

Second, generating from an xmi file is supported Smile. Whatever the extension of your file (even if it has no extension), as long as it is a model that can be loaded with EMF, it is supported by Acceleo.

As for the error you have, "the type [...] is a proxy" indeed spans from the metamodel being unknown to Acceleo (or, more generally, to Eclipse).
[module tdmodel('tdmodel')]
means that you have in that Eclipse a metamodel going by the NsURI "tdmodel". It also means that in the generated Acceleo launcher, you have to register that same metamodel through code if it is not pluginized. (See also what Joachim has done with the "registerPackages" method of that class and my answer to his problem (which is the same has your BTW).)

Laurent Goubet
Obeo

[Updated on: Mon, 01 August 2011 08:41]

Report message to a moderator

Re: [Acceleo 3.1] Problem launching transformation [message #708845 is a reply to message #707100] Wed, 03 August 2011 08:07 Go to previous message
JM Gauthier is currently offline JM Gauthier
Messages: 25
Registered: June 2011
Junior Member
Hi laurent!

Thanks for reply!
So, actually it's working : the NsURI is the same for the metamodel and for the module. Morevover, I had to put the compiler properties to "Binary". I don't really get the differences but now it's working with a "Run configuration".

Thanks again for help!!

[Updated on: Wed, 03 August 2011 13:16]

Report message to a moderator

Previous Topic:Calling acceleo from a java method (IField) instead of a java class (IFile)
Next Topic:[acceleo] mtl and emtl, what is the difference?
Goto Forum:
  


Current Time: Thu Oct 23 22:10:36 GMT 2014

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

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