Error in running Acceleo project [message #1819490] |
Thu, 16 January 2020 08:44 |
maryam mehrabi Messages: 25 Registered: May 2019 |
Junior Member |
|
|
hello all,
I am new in acceleo,
when I created my first simple acceleo project based on my own simple metamodel, I have gotten the errors below. I will appreciate if anyone could help!
this is my code:
when I chose java application as Runner in run configuration, I got this error:
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.example.org/kbei_metamodel' not found. (file:/C:/Users/MARIA/eclipse-workspace/org.eclipse.acceleo.module.test/My.kbei_metamodel, 2, 136)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:391)
at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:356)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:488)
at org.eclipse.acceleo.module.test.main.Generate.<init>(Generate.java:90)
at org.eclipse.acceleo.module.test.main.Generate.main(Generate.java:144)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.example.org/kbei_metamodel' not found. (file:/C:/Users/MARIA/eclipse-workspace/org.eclipse.acceleo.module.test/My.kbei_metamodel, 2, 136)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2643)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2476)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1353)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1522)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1044)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:78)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1026)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:720)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:745)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1289)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3132)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:852)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1563)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1342)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 6 more
and when I chose Acceleo plug-in Application as Runner, I didn't get error in console, but there is not generated any code and I see these errors in error log.
best regards,
maryam
[Updated on: Thu, 16 January 2020 08:46] Report message to a moderator
|
|
|
|
|
|
|
Re: Error in running Acceleo project [message #1821146 is a reply to message #1819507] |
Thu, 06 February 2020 10:24 |
Elie Richa Messages: 72 Registered: February 2016 |
Member |
|
|
Hello Maryam,
As Ed suggested, I believe you should look at the Java class generated automatically next to your main Acceleo module.
In that class there's a method called registerPackages() where you need to register your metamodel. There are instructions there on how to do that.
Good luck!
Elie Richa, Ph.D
Software Engineer, AdaCore
https://www.adacore.com
|
|
|
Powered by
FUDForum. Page generated in 0.25652 seconds