Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo [ Run problem](I want to generate Java code for my graphical model defined by sirius )
Acceleo [ Run problem] [message #1829077] Wed, 24 June 2020 19:46 Go to next message
Sel ma is currently offline Sel maFriend
Messages: 9
Registered: June 2020
Junior Member
Hello all,
I am new to Accelo and I need urgent guidance

1. First,I have created my DSL metamodel ( pfe.ecore) and then I generated the java classes of this metamodel using Accelo based on the. Ecore[I got .java file for each class of my metamodel] _the name of the Accelo project is MyTransformationM2T workspace image 1st attachment attachment 4 for the project

2. Second, I have created Sirius graphical model (MyPfe.pfe)based on my DSL on Eclipse Run time that contains the diagram (VLC) that I want to generate its java code, for that 2nd attachment , I have created another Acceleo project in the workplace(org.eclipse.aceleo.sirius) and then I have imported in this project the file( MyPfe.pfe and the newDiagrams.aid ) 3rd attachment

Now I want just to make sure I am on the right path before going further, I wrote some text in the file generate.mtl see attachment 3 of (org.eclipse.aceleo.sirius attatchemet 4) project and I launch an Accelo run configuration with two options :

1st option As an URL model /org.eclipse.acceleo.sirius/MyPfe.pfe

just after, I got a run error :

org.eclipse.acceleo.engine.AcceleoEvaluationException: Couldn't evaluate URL of the file at line 7 in Module generate for block file(anInteractionSpatiale.name, false, 'UTF-8'). Last recorded value of self was org.eclipse.sirius.sample.pfe.impl.InteractionSpatialeImpl@7674b62c (name: null).
	at generate.generateElement(InteractionSpatiale)(generate.mtl:7)
	at generate.generateElement(InteractionSpatiale)(generate.mtl:5)


2nd option

But If I sure the URL in the Model /org.eclipse.acceleo.sirius/newDiagrams.aird I got the error of :
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/sirius/diagram/description/1.1.0' not found. (file:/C:/Users/ABL/Desktop/PFE/ObeoDesigner-Community/workspace/org.eclipse.acceleo.sirius/newDiagrams.aird, 10, 247)
	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.sirius.main.Generate.<init>(Generate.java:91)
	at org.eclipse.acceleo.sirius.main.Generate.main(Generate.java:145)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/sirius/diagram/description/1.1.0' not found. (file:/C:/Users/ABL/Desktop/PFE/ObeoDesigner-Community/workspace/org.eclipse.acceleo.sirius/newDiagrams.aird, 10, 247)
	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.createObjectFromTypeName(XMLHandler.java:2126)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2085)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:151)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1894)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1048)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:82)
	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(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.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: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




So, My questions :

1. I get confused which URL Model to use in the Accelo run configuration: either /org.eclipse.acceleo.sirius/MyPfe.pfe or /org.eclipse.acceleo.sirius/newDiagrams.aird

2. Do I need to generate the java classes of my metamodel before I generate the code of the graphical diagram as I did ? -I thought I will use them as Datatypes for my code.

3. How can I generate the java code of the graphical diagram VLC using Accelo?


Regards. Selma

[Updated on: Thu, 25 June 2020 19:47]

Report message to a moderator

Re: Acceleo [ Run problem] [message #1829177 is a reply to message #1829077] Fri, 26 June 2020 11:12 Go to previous messageGo to next message
Sel ma is currently offline Sel maFriend
Messages: 9
Registered: June 2020
Junior Member
Anyone can help?
Re: Acceleo [ Run problem] [message #1829181 is a reply to message #1829177] Fri, 26 June 2020 13:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6755
Registered: July 2009
Senior Member
Hi

If you want help, a zipped project is always a good start as produced by the Export action.

It also help when what you write is not impossible.

Acceleo has no default ability to convert a *.ecore file to Java, although an enthusiast could write one. Most users use the EMF JET templates to generate Java from Ecore via the GenMOdel capability. I recall that there was an effort to migrate the JET templates to Acceleo, but I have never used them and I guess that they have gone stale since no one was interested in maintaining them to a standard that might make them usable.

You almost never want to have anything to do with a *.aird file. It is an unpleasant administrative evil of the Sirius tooling that I am forever hoping will vanish.

Regards

Ed Willink
Re: Acceleo [ Run problem] [message #1829205 is a reply to message #1829181] Sat, 27 June 2020 17:51 Go to previous message
Sel ma is currently offline Sel maFriend
Messages: 9
Registered: June 2020
Junior Member
Hi Ed Willink,

Thank you for the replay,
I have fixed most of the errors and I used the .pfe as a model for my Accelo project and it works [indeed no need of *.aird ].

Thank you for the clue about EMF JET , I will check them out

Regards.
Selma

Previous Topic:Importing a module from a plugin into a module of an Acceleo project
Next Topic:Acceleo
Goto Forum:
  


Current Time: Thu Jul 02 19:53:45 GMT 2020

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

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

Back to the top