Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [acceleo] another acceleo standalone question(type of first parameter of template is a proxy)
icon5.gif  [acceleo] another acceleo standalone question [message #1039130] Thu, 11 April 2013 19:58 Go to next message
Mathias Colpaert is currently offline Mathias ColpaertFriend
Messages: 13
Registered: November 2012
Junior Member
Hi,
It may seem like I am asking a question already asked before, but the solutions indicated in the other forum posts don't work for me.

I am trying to run an Acceleo project in a standalone.

public void registerPackages(ResourceSet resourceSet) {
        super.registerPackages(resourceSet);
        
        if(!isInWorkspace(PSMAndroid.PSMAndroidPackage.class)){
        	System.out.println("uri: "+PSMAndroid.PSMAndroidPackage.eNS_URI); 
     	        resourceSet.getPackageRegistry().put(PSMAndroid.PSMAndroidPackage.eNS_URI, PSMAndroid.PSMAndroidPackage.eINSTANCE);
        }
}


And also:

public void registerResourceFactories(ResourceSet resourceSet) {
        super.registerResourceFactories(resourceSet);
        resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("psmandroid",new XMIResourceFactoryImpl());
}


The module looks like this:
[module componentModule('org.colpaert.mathias.PSMAndroid')]


I am getting following error:
Quote:
org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the first parameter of the main template named 'generateModel' is a proxy.


I looked at other posts, but none of that works for me. (I would post the links, but the forum is preventing me because I dont have enough posts :/ )

The generator worked when launched as "acceleo application", without the lines of code above. When I add the lines, running as java application I get the error above. But when I try to run as "acceleo application" again, I get following error:
index.php/fa/14346/0/

So that does not work anymore.

What should I do?

extra info: I added the ecore model (project with model & genmodel etc) as a project reference in the build path properties of my acceleo generation project.

  • Attachment: error.PNG
    (Size: 12.23KB, Downloaded 565 times)
Re: [acceleo] another acceleo standalone question [message #1049256 is a reply to message #1039130] Thu, 25 April 2013 15:21 Go to previous message
Mathias Colpaert is currently offline Mathias ColpaertFriend
Messages: 13
Registered: November 2012
Junior Member
The problem was in my metamodel URI. The metamodel was defined using ecore,
you should always put "http://" in front of the metamodel URI!

The name of my metamodel was:
org.colpaert.mathias.PSMAndroid, it is was imported in my acceleo module as following:
[module model('org.colpaert.mathias.PSMAndroid')/]

This caused acceleo to look for the metamodel in a path relative to the module file. In a standalone, after compilation, this is just the /bin folder.

I changed my ecore metamodel URI, regenerated the genmodel (etc). Next I changed the acceleo module to:
[module model('http://org.colpaert.mathias.PSMAndroid')/],
Cleaned the solution, recompiled and it worked.

Big thanks to Stéphane Bégaudeau, he solved this here (its in french)
Previous Topic:[Acceleo] Java Services classpath
Next Topic:XPand: No definition Found
Goto Forum:
  


Current Time: Thu Apr 25 16:04:26 GMT 2024

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

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

Back to the top