[Acceleo] Class 'System' is not found or is abstract [message #895088] |
Wed, 11 July 2012 16:31  |
Toni Marin Messages: 7 Registered: October 2011 |
Junior Member |
|
|
Hi everyone,
We are trying to generate Lydia code from an xmi file. But we get the error "Class 'System' is not found or is abstract".
SO, we are using our own ecore metamodel. All packages are registered in the generated java file (I read it is not possible to register the metamodel alone when it is made of different packages, but all packages have to be individualy registered).
We use Indigo version.
The input model is an .xmi file. Here is the code we use for registering the factory resource:
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());
The heading of the input model is:
<?xml version="1.0" encoding="ASCII"?>
<STRUCT:[b]System[/b] xmi:version="2.0"
xmlns:STRUCT="http: //zuse.ucc.ie/itobo/structure"
xmlns:DX="http: //zuse.ucc.ie/itobo/diagnosis"
xmlns:PL="http: //zuse.ucc.ie/itobo/propositionallogic"
name="main">
All this packages are registered in the generated java file.
resourceSet.getPackageRegistry().put("http: //zuse.ucc.ie/itobo/structure", org.eclipse.emf.ecore.EcorePackage.eINSTANCE);
However registering everything, the error "class "System" is not found or is abstract" still comes up.
Also, sometimes the error "emtl file is not found" appears (may be significant(?))
Any help will be greatly appreciated.
Cheers
[Updated on: Thu, 12 July 2012 14:35] Report message to a moderator
|
|
|
|
Re: [Acceleo] Class 'System' is not found or is abstract [message #895848 is a reply to message #895367] |
Mon, 16 July 2012 09:54   |
Toni Marin Messages: 7 Registered: October 2011 |
Junior Member |
|
|
Hi Stephane,
I am a little confused. The project has no genmodel. It has the mtl file, the generated java file, the ecore meta-model and the xmi input model.
Please see here a screenshot of the project explorer and the registerPackages() function in Generate.java:
https: //dl.dropbox.com/u/50566170/Screenshot.png (remove space)
Does the project require a genmodel?
Regards and Thanks,
[Updated on: Mon, 16 July 2012 09:57] Report message to a moderator
|
|
|
|
Re: [Acceleo] Class 'System' is not found or is abstract [message #898065 is a reply to message #895856] |
Wed, 25 July 2012 17:36   |
Toni Marin Messages: 7 Registered: October 2011 |
Junior Member |
|
|
Thanks Ed,
I added this code:
Resource resource =
resourceSet.getResource(URI.createFileURI("./src/org/itobo/modeltotext/common/System.ecore"), true);
EPackage ePackage = (EPackage) resource.getContents().get(0);
EPackage.Registry.INSTANCE.put(ePackage.getNsURI(), ePackage);
But this applies only to the ecore meta-model. How can each ePackake be registered since they are all share the same ecore meta-model path?
Same error "class not found" comes up.
Cheers and Thanks
[Updated on: Wed, 25 July 2012 17:48] Report message to a moderator
|
|
|
|
Re: [Acceleo] Class 'System' is not found or is abstract [message #898362 is a reply to message #898085] |
Thu, 26 July 2012 09:29   |
Toni Marin Messages: 7 Registered: October 2011 |
Junior Member |
|
|
Thanks, I tried that with this code:
Resource resource = resourceSet.getResource(URI.createFileURI("./src/org/itobo/modeltotext/common/System.ecore"), true);
for (Iterator iter = resource.getContents().iterator(); iter.hasNext();) {
EPackage element = (EPackage) iter.next();
resourceSet.getPackageRegistry().put(element.getNsURI(), element);
}
It only iterates on the main package not entering the sub-packages where the actual classes are (see dl.dropbox.com/u/50566170/Ecore.png).
I know this is more like a java question, but any help is very welcome,
Thanks
[Updated on: Thu, 26 July 2012 09:46] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02334 seconds