Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Error in running Acceleo project
Error in running Acceleo project [message #1819490] Thu, 16 January 2020 08:44 Go to next message
maryam mehrabi is currently offline maryam mehrabiFriend
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:

index.php/fa/37175/0/

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.

index.php/fa/37174/0/

best regards,
maryam

[Updated on: Thu, 16 January 2020 08:46]

Report message to a moderator

Re: Error in running Acceleo project [message #1819492 is a reply to message #1819490] Thu, 16 January 2020 08:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6840
Registered: July 2009
Senior Member
Hi

This looks like the standard newbie problem.

You have not read the comments in the generate Java main program.

Regards

Ed Willink
Re: Error in running Acceleo project [message #1819495 is a reply to message #1819492] Thu, 16 January 2020 09:43 Go to previous messageGo to next message
maryam mehrabi is currently offline maryam mehrabiFriend
Messages: 25
Registered: May 2019
Junior Member
Thanks for your fast answer,

but I am sorry, may I ask you to explain more? I see the generate.java but I don't know what should I find in it :-)
Re: Error in running Acceleo project [message #1819497 is a reply to message #1819495] Thu, 16 January 2020 11:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6840
Registered: July 2009
Senior Member
Hi

Sorry I don't use Acceleo any more so I don;'t have an example to hand.

However my recollection is that very near the end are some very clear instructions on how to register your metamodel(s).

It is of course a pity that Acceleo does not exploit the solution that it had when editing your transformation to accurately populate the code for execution time.

Regards

Ed Willink
Re: Error in running Acceleo project [message #1819507 is a reply to message #1819497] Thu, 16 January 2020 13:04 Go to previous messageGo to next message
maryam mehrabi is currently offline maryam mehrabiFriend
Messages: 25
Registered: May 2019
Junior Member
any one else could help?
Re: Error in running Acceleo project [message #1821146 is a reply to message #1819507] Thu, 06 February 2020 10:24 Go to previous message
Elie Richa is currently offline Elie RichaFriend
Messages: 19
Registered: February 2016
Junior 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!
Previous Topic:Access to target folder from within Acceleo generation
Next Topic:Acceleo source generator always replaces target file
Goto Forum:
  


Current Time: Mon Sep 21 03:07:05 GMT 2020

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

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

Back to the top