Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Nothing is being generated(My first attempt is not going well.)
Nothing is being generated [message #1766802] Tue, 27 June 2017 12:13 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 52
Registered: July 2016
Member
I have the latest, eclipse (neon) with papyrus/accelo installed.

In the launcher configuration dialog, I am seeing this at the top:

Due to changes in the Eclipse platform in Luna, the Acceleo Plug-in Application strategy may not work.

I am trying to generate anything at this point. I get directories created but no file. No errors either. No output of any kind.

Do I need to use an older version? If so what?

Thanks in advance

Re: Nothing is being generated [message #1766818 is a reply to message #1766802] Tue, 27 June 2017 14:42 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Geoffry,

This warning is there to tell you that the "plug-in application" choice of the launch configuration is not functional anymore. However, you can still generate code with either the "Java application" choice (see image below) or through the use of a acceleo UI launcher plug-in.

The documentation is not really up-to-date, but you can find information on how to create a UI launcher for Acceleo in the Getting Started guide.

http://i.imgur.com/Cby5wnM.png

Laurent Goubet
Obeo
Re: Nothing is being generated [message #1766819 is a reply to message #1766818] Tue, 27 June 2017 14:51 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 52
Registered: July 2016
Member
Thanks for responding

Running as a java application is what I tried first as per the example you show.

I get an error when I do this, which is why I switched to the plugin.

Error:

java.lang.IllegalStateException: Workspace is closed.
Usage arguments:
  [-projects <project-root-directory>]
	at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:412)
	at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.run(Generator.java:145)
	at org.eclipse.emf.codegen.ecore.Generator.run(Generator.java:112)
	at org.eclipse.emf.codegen.ecore.Generator.main(Generator.java:83)
  [-dynamicTemplates] [-forceOverwrite | -diff]
  [-generateSchema] [-nonNLSMarkers]
  [-codeFormatting { default | <profile-file> } ]
  [-model] [-edit] [-editor] [-tests]
  [-autoBuild <true|false>]
  [-reconcile]
  <genmodel-file-or-platform-resource-uri>
  [ <target-root-directory> ]

For example:

  generate result/model/Extended.genmodel
java.lang.IllegalStateException: Workspace is closed.
	at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(ResourcesPlugin.java:412)
	at org.eclipse.emf.codegen.ecore.Generator$PlatformRunnable.run(Generator.java:145)
	at org.eclipse.emf.codegen.ecore.Generator.run(Generator.java:112)
	at org.eclipse.emf.codegen.ecore.Generator.main(Generator.java:83)
Re: Nothing is being generated [message #1766973 is a reply to message #1766819] Thu, 29 June 2017 08:15 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

This doesn't look like an Acceleo generation... are you trying to generate the genmodel code from within an Acceleo launcher/template?

Laurent Goubet
Obeo
Re: Nothing is being generated [message #1766978 is a reply to message #1766973] Thu, 29 June 2017 08:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7676
Registered: July 2009
Senior Member
Hi

Ok, Laurent is baffled too so it doesn't seem like an Acceleo functionality that I'm unfamiliar with.

"at org.eclipse.emf.codegen.ecore.Generator.main(Generator.java:83)"

strongly suggests that the EMF Generator has been launched as a Java application. I didn't know this facility existed. There is an ANT task for dedicated enthusiast. I use an MWE2 component.

How/why are you launching org.eclipse.emf.codegen.ecore.Generator.main?

I suspect a mad launch config. But without a zipped project repro including the launch (save it via the Common tab) I doubt that we can help you further.

Regards

Ed Willink

Re: Nothing is being generated [message #1766996 is a reply to message #1766978] Thu, 29 June 2017 12:03 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 52
Registered: July 2016
Member
Thanks Ed and Laurent I am getting oriented to this business.

Yes, the launcher was pointed to the EMF generator. I notice in the example that I should be launching ~.Uml2java, but that option is not appearing in the launcher dialog pick list for Main class:/Search
I did install Uml2java from the marketplace. I can find the class in question in my .p2 repository. I tried manually entering it into the dialog, but got a CNF exception. I'll bet I'm missing something.

Any ideas?

Thanks again
Re: Nothing is being generated [message #1766997 is a reply to message #1766996] Thu, 29 June 2017 12:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7676
Registered: July 2009
Senior Member
Hi

Can you Focus on it with Navigate->Open Type in Hierarchy.... You probably need to put UML2Java on the classpath of some (any will do) project.

Regards

Ed Willink
Re: Nothing is being generated [message #1767012 is a reply to message #1766997] Thu, 29 June 2017 13:58 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

Okay so if I understand correctly you've pointed the "main" class of the Acceleo launch config towards the EMF "Generator" class. Truth be told I didn't even know that was possible.

The "main class" field of your launch configuration needs to be pointed towards an Acceleo generator's main class. This is the java class that's generated beside the ".mtl" file containing a template with the "@main" annotation.

Please look at the "Getting Started" guide on the wiki. though some of the screenshot there need to be reworked, the information should still answer some of your issues and help you get a first generator running.

Laurent Goubet
Obeo
Re: Nothing is being generated [message #1767016 is a reply to message #1767012] Thu, 29 June 2017 14:24 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 52
Registered: July 2016
Member
I appreciate the responsiveness. I have a major use case if I can just get things going.

I finally got something to generate. I was lacking a Generate.java file to go with my generate.mtl. I recreated the project and let the wizard make me one. Now I can focus on learning the templates. Ultimately, I'll have to do this with maven.

Thanks again.
Re: Nothing is being generated [message #1767037 is a reply to message #1767012] Thu, 29 June 2017 19:33 Go to previous messageGo to next message
Tomasz  abczy?ski is currently offline Tomasz abczy?skiFriend
Messages: 11
Registered: May 2015
Junior Member
Hi Laurent,
I have updated the tutorial to acceleo v 3.3 and later and put it here:
https://wiki.eclipse.org/Acceleo/Getting_Started_33

Later I've added some information but haven't put them into the eclipse wiki yet. It is on my own wiki pages:
http://kompilatory.iiar.pwr.edu.pl/wiki/index.php/Acceleo/Getting_Started_33

Could you, please review it and say whether it can be linked to the main acceleo wiki or not?

Tomasz Babczyński


Tomasz Babczyński
Re: Nothing is being generated [message #1767091 is a reply to message #1767037] Fri, 30 June 2017 14:52 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Your page seems fine to me Tomasz, but we do not intend on linking people to external pages for the acceleo documentation, especially on something like the getting started that is supposed to be a started guide.

Going through the documentation ti try and update the old stuff is in my backlog, so I expect the "regular" getting started (https://wiki.eclipse.org/Acceleo/Getting_Started) to be updated with new screenshots sooner or later. Could you update that page?

Laurent Goubet
Obeo
Re: Nothing is being generated [message #1767162 is a reply to message #1767091] Sun, 02 July 2017 20:11 Go to previous messageGo to next message
Tomasz  abczy?ski is currently offline Tomasz abczy?skiFriend
Messages: 11
Registered: May 2015
Junior Member
I am not too familiar with wiki so I was afraid to damage the original page. OK. I could try to do it. (not damage of course ;)

T.B.


Tomasz Babczyński
Re: Nothing is being generated [message #1767170 is a reply to message #1767162] Mon, 03 July 2017 07:09 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
No problem Tomasz, the wikis have an history so you won't be able to damage it beyond repair even if you mess up :). Update the existing pages at ease.

Laurent Goubet
Obeo
Previous Topic:Stereotypes
Next Topic:Artifact fileName
Goto Forum:
  


Current Time: Tue Oct 08 09:49:32 GMT 2024

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

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

Back to the top