Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] PackageNotFoundException(I'm trying to generate code from an instance of a metamodel)
[Acceleo] PackageNotFoundException [message #1736373] Wed, 29 June 2016 01:00 Go to next message
Higo Felipe is currently offline Higo FelipeFriend
Messages: 4
Registered: June 2016
Junior Member
Hello.

I'm working on a DSL metamodel now. After this metamodel, I ran an instance (.editor -> Run As -> Eclipse Application) and created on it a model and a Acceleo Project to code generation.

When I try to run the Acceleo application, I have, however, an error message:

Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'hxxp://www.example.org/classdiagram' not found. (file:/C:/Users/Higo/runtime-EclipseApplication/exemplo/My.classdiagram, 2, 199)
	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:475)
	at org.eclipse.acceleo.module.sample.main.Generate.<init>(Generate.java:90)
	at org.eclipse.acceleo.module.sample.main.Generate.main(Generate.java:144)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'hxxp://www.example.org/classdiagram' not found. (file:/C:/Users/Higo/runtime-EclipseApplication/exemplo/My.classdiagram, 2, 199)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2625)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1335)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:77)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
	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.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
	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:1518)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
	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


Since I have no experience with Acceleo, I can not precisely identify a cause for this error message. How could I fix it?

Best regards,

Higo.
Re: [Acceleo] PackageNotFoundException [message #1736593 is a reply to message #1736373] Thu, 30 June 2016 14:00 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1857
Registered: July 2009
Senior Member
Hi,

Please look at the comments in the generated java launcher beside your main template (org.eclipse.acceleo.module.sample.main.Generate.java) for an example of how to register your metamodels. You'll need a direct dependency from your generator project to the project that hosts your your metamodel as well for it to work properly.

See also the answer on this earlier thread.

Please keep us informed if you still don't manage to get it running.

Laurent Goubet
Obeo
Re: [Acceleo] PackageNotFoundException [message #1736843 is a reply to message #1736593] Sat, 02 July 2016 21:23 Go to previous message
Higo Felipe is currently offline Higo FelipeFriend
Messages: 4
Registered: June 2016
Junior Member
Thank you for the answer, and sorry for the late response.

I already managed to work around the issue. The application is running now.

Best regards,

H.
Previous Topic:[Acceleo] Custom Acceleo metamodel
Next Topic:[Acceleo 3] Multiple metamodels
Goto Forum:
  


Current Time: Mon Jul 16 06:53:15 GMT 2018

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

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

Back to the top