[ATL]Java Heap Space Error importing ECore Model [message #58014] |
Thu, 16 August 2007 11:03  |
Eclipse User |
|
|
|
Originally posted by: maximilian.weinhart.sdm.de
Hi,
I am complete new to ATL.
Explanation to attached Files:
StorageMModel.ecore : Metamodel (generated through reflective ecore
functions)
StorageMInstance.ecore : Instance of the Metamodel (generated through
reflective ecore functions)
NodesEdgesMModel.ecore : Metamodel of the model which should be generated in
future.
When i try to execute the transformation in eclipse a Java heap space-Error
occurs.
My storage2Visio.atl-File contains no rules. So normally a empty outputfile
should be generated, right ?
Because of the stack-trace I think the error is in EMF.
I generated the ecore-Models by using the reflective-functions of ecore.
And it is possible to read both models StorageMModel.ecore (metamodel) and
StorageMInstance (modelinstance) back in via ECore like this :
// create resource set and resource
ResourceSet resourceSet = new ResourceSetImpl();
// Register XML resource factory
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "xmi",
resFactImpl);
Resource resourceModelLoad = resourceSet.createResource(
URI.createFileURI( sourceFile ) );
Map options = new HashMap();
resourceModelLoad.load( options );
EPackage rootPackage = (EPackage) resourceModelLoad.getContents().get(0);
So I think the format of the ECore-models should be correct.
What
|
|
|
|
Re: [ATL]Java Heap Space Error importing ECore Model [message #58355 is a reply to message #58144] |
Fri, 17 August 2007 16:35  |
Eclipse User |
|
|
|
Hi,
> I guess I have found out why the Error occured.
> I defined twosided containments (means two references wich both have
> containment=true and belong to the same relation),
> wich is obviously not allowed. So i think that leads to a neverending
loop.
> And so a Java Heap Error occurs.
>
> But i think it would be nice to detect such loops an not simply let Java
> fill up the heap.
> I don´t know the implementation but i think it should be possible to
> implement a mechanism to
> detect loops and throw an "normal" exception instead of filling the heap.
If you want such a mechanism to be implemented in EMF, you should
probably report this issue on the EMF newsgroup.
KM3 metamodels are checked for problems before being transformed (e.g.,
into Ecore metamodels). This way, you can avoid many mistakes.
The transformation that performs these checks is available at:
http://www.eclipse.org/m2m/atl/atlTransformations/#KM32Probl em
However, the current version does not seem to check for the problem you
encountered.
Could you please open a bugzilla entry in GMT/AM3 (where KM3 is)?
This may be done by following this link:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=AM3
Do not hesitate to also contribute a fix ;-).
Thanks,
Frédéric
|
|
|
Powered by
FUDForum. Page generated in 0.03047 seconds