Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] running transformations programatically under xmi
[ATL] running transformations programatically under xmi [message #91492] Tue, 07 October 2008 03:22
neto Mising name is currently offline neto Mising nameFriend
Messages: 33
Registered: July 2009
Member
Hi,

i have a big problem. Well, i must run programatically some ATL
transformations under UML models described by xmi generated by a modeling
tool (like MagicDraw or Omondo).

Well, i execute my transformation using the eclipse plugin. And their work
perfectally. But, when i execute programatically this exeception is
throwed:

06/10/2008 20:58:47 org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
loadASMEMFModel
SEVERE: Package with uri 'http:///_zrN_0SUoEdmNXYQzyImvfA.profile.uml2'
not found.
( file:///C:/Users/Netuh/Desktop/eclipse%20Place/workspace/UDT 2/IN, 18218,
99)
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
uri 'http:///_zrN_0SUoEdmNXYQzyImvfA.profile.uml2' not found.
( file:///C:/Users/Netuh/Desktop/eclipse%20Place/workspace/UDT 2/IN, 18218,
99)
at
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLL oadImpl.java:83)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:191)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1414)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:365)
at
0rg.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:222)
at
br.edu.gmf.udt.m2m.atl.ATLExecutor.createASMMetamodel(ATLExe cutor.java:126)
at br.edu.gmf.udt.m2m.atl.ATLExecutor.initInputModels(ATLExecut or.java:179)
at
br.edu.gmf.udt.m2m.atl.ATLExecutor.makeTransformation(ATLExe cutor.java:147)
at
br.edu.gmf.udt.m2m.atl.ATLExecutor.executeTransformations(AT LExecutor.java:226)
at br.edu.gmf.udt.AbsExecutor.generateTests(AbsExecutor.java:28 )
at br.edu.gmf.udt.UDTExecutor.main(UDTExecutor.java:53)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
with uri 'http:///_zrN_0SUoEdmNXYQzyImvfA.profile.uml2' not found.
( file:///C:/Users/Netuh/Desktop/eclipse%20Place/workspace/UDT 2/IN, 18218,
99)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2566)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2398)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1276)
at
rg.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XML Handler.java:1445)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1010)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:992)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(AbstractSAXParser.java:501)
at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(AbstractXMLDocumentParser.java:179)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(XMLDocumentFragmentSca nnerImpl.java:2747)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(XMLDocumentScannerImpl.java:648)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.next(XMLNSDocumentScannerImpl.java:140)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java: 510)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:807)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(XML11Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(X MLParser.java:107)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(AbstractSAXParser.java:1205)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
... 10 more






well, i note that these uri are on the xmi header in the
xsi:schemaLocation. And i register the UML URI as the code behind:

ResourceSet resourceSet = ASMEMFModel.getResourceSet();
resourceSet.getPackageRegistry().put(
"http://www.eclipse.org/uml2/2.0.0/UML", UMLPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(
"http://www.eclipse.org/uml2/2.1.0/UML",UMLPackage.eINSTANCE);

URI uri = URI.createURI("jar:file:///C:/Users/Netuh/Desktop/eclipse
Place/workspace/GeneratorTool/lib/org.eclipse.uml2.uml.resou rces_2.2.0.v20080309.jar!/ ");
Map<URI, URI> uris = URIConverter.URI_MAP;
uris.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri
.appendSegment("libraries").appendSegment(""));
uris.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri
.appendSegment("metamodels").appendSegment(""));
uris.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri
.appendSegment("profiles").appendSegment(""));

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);




Any sugestion?

Thanks in advance,

Waldemar
Previous Topic:[ATL] running transformations programatically with superimpose
Next Topic:Matched rule without a "to" section
Goto Forum:
  


Current Time: Mon Oct 07 01:25:50 GMT 2024

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

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

Back to the top