Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Loading ATL programmatically. PackageNotFoundException
Loading ATL programmatically. PackageNotFoundException [message #90142] Wed, 17 September 2008 16:30
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi,

I am trying to load an atl transformation from code using ATLLauncher but
I have problem loading my model for a multipackage ecore MetaModel while
the metamodel it self is loaded correctly.
I am using EMFModelLoader to retrieve my model :


EMFModelLoader loader = new EMFModelLoader();
loader.loadModel("IN", KDMMModel, transformationsMetamodels +
"kdm/model.kdm");


KDMMModel is the metamodel I loaded before using one if its packages URIs :


KDMMModel = emfamh.loadModel("kdm", emfamh.getMof(),
"uri:http://kdm.omg.org/code");


Here's a simplified version of the model :

<?xml version="1.0" encoding="ASCII"?>
<kdm:Segment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:code="http://kdm.omg.org/code" xmlns:kdm="http://kdm.omg.org/kdm"
name="default">
<model xsi:type="code:CodeModel" name="default">
<codeElement xsi:type="code:LanguageUnit" name="Cobol Language Unit"/>
</model>
</kdm:Segment>

I always get PackageNotFoundExeption. Hereby the stack trace :

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
'http://kdm.omg.org/kdm' not found. (IN, 2, 248)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:1730)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:1568)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:717)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:779)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:462)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:65)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:449)
at
org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(SAXWr apper.java:73)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDriver.scanRootElementHook(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$PrologDriver.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:140)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:169)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:977)
at
org.atl.engine.repositories.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:341)
at
org.atl.eclipse.engine.AtlEMFModelHandler.loadModel(AtlEMFMo delHandler.java:110)

I would like your opinion on this before sumbmitting it as a bug report.
The strange thing is that it don't find the uri http://kdm.omg.org/kdm and
seems to find all the others, I first doubted that it's was because both
my ecore root and one of it's EPackage have the same name 'kdm' but even
after changing the root name I still get this error.

Thanks a lot,
Previous Topic:Sequence Diagram to Java Code questions
Next Topic:[ATL] How to use UML with profile as input to a transformation
Goto Forum:
  


Current Time: Sun Sep 22 01:23:58 GMT 2024

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

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

Back to the top