[acceleo] another acceleo standalone question [message #1039130] |
Thu, 11 April 2013 15:58  |
Eclipse User |
|
|
|
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:
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 662 times)
|
|
|
Re: [acceleo] another acceleo standalone question [message #1049256 is a reply to message #1039130] |
Thu, 25 April 2013 11:21  |
Eclipse User |
|
|
|
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)
|
|
|
Powered by
FUDForum. Page generated in 0.07448 seconds