[Acceleo] "Selection does not contain a main type ..." [message #636261] |
Fri, 29 October 2010 20:00  |
Eclipse User |
|
|
|
Cannot figure out at all, here is the message I get :
"Selection does not contain a main type (@main annotation is missing in your template)"
I've tried many times, with the most simple things ever, it does not want to work any more.
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/3.0.0/UML')/]
[template public generate(p : Package)]
[comment @main /]
[file (p.name, false, 'UTF-8')]
[p.name/]
[/file]
[/template]
As you see, the annotation is really there.
Step :
* New Acceleo project
* Click finish ()what ever the options are, this is the same)
* Right click on generate.mtl
* Run As ...
* Error message
I was working on a transformation for some time, when I decided to remove it and restart from the ground-up. When I wanted to create a new project, I get this.
It was working fine before, not any more, and it complains about a missing annotation which is there.
Any one already get the same ? How to solve ?
-- EIT --
Here is an error log I get about Acceleo :
"Resource '/org.eclipse.acceleo.module.sample/src/org/eclipse/acceleo/ module/sample/files/generate.mtl' does not exist."
But that file exist, and I've checked the path is good; this is the same path as in the file's properties.
Acceleo seems really confused here (note : I do not know when this error logs line appeared).
-- EDIT (2) --
Seems to have something to deal with the workspace, as if I switch workspace, then the above does not fail. Precisely, the ".metadata" subdirectory of the workspace seems involved.
[Updated on: Fri, 29 October 2010 22:02] by Moderator
|
|
|
|
|
Re: [Acceleo] "Selection does not contain a main type ..." [message #636318 is a reply to message #636316] |
Sat, 30 October 2010 16:23  |
Eclipse User |
|
|
|
Hi Laurent 
Laurent Goubet wrote on Sat, 30 October 2010 15:37 | Hi Yannick,
I am quite puzzled as how you could end up with such errors ... Are you
sure you have the automatic build activated (in Eclipse : "Project" >
"Build Automatically" is ticked)?
|
Great, that was it ! I use to uncheck it for something relying on an external compiler in a specific view, and though this option applied on a view basis. No, seems now it is global (further more, I then hided this option from the menu for all views).
Valuable answer : it solved the trick and it explains why it was not working (I've learned something). Always good to ask an expert.
Laurent Goubet wrote on Sat, 30 October 2010 15:37 | Do you have a "xxx.java" file
generated right beside the "xxx.mtl" file you're trying to launch?
|
I had noticed that indeed, in the second message (in the EDIT). But I could not guess this required "Build automatically", as I though this Java file was created in the while during a project creation.
Hope I could contribute one future day, at least to thank.
Have a nice day
|
|
|
Powered by
FUDForum. Page generated in 0.04466 seconds