Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] "Selection does not contain a main type ..."
[Acceleo] "Selection does not contain a main type ..." [message #636261] Sat, 30 October 2010 00:00 Go to next message
Yannick Duchene (Hibou57) is currently offline Yannick Duchene (Hibou57)Friend
Messages: 50
Registered: September 2010
Location: Metz (France - Europe)
Member
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: Sat, 30 October 2010 02:02]

Report message to a moderator

Re: [Acceleo] "Selection does not contain a main type ..." [message #636283 is a reply to message #636261] Sat, 30 October 2010 11:33 Go to previous messageGo to next message
Yannick Duchene (Hibou57) is currently offline Yannick Duchene (Hibou57)Friend
Messages: 50
Registered: September 2010
Location: Metz (France - Europe)
Member
This work temporarily if I restart with a new workspace, but after some time, Acceleo ends to be always back to the above error.

Am I the only one with this bug ?

I suspected something in the Preferences, but there is no entry for Acceleo there.

Is there a way to attach a file here ? I would like to attach an archive of the ".metadata" folder, as I suspect the cause in somewhere in there.

-- EDIT -- When it fails, there is only a generate.mtl and no Generate.java. So when the workspace contains some stuffs (do not know what), Acceleo does not create the Generate.java when it creates an Acceleo project.

[Updated on: Sat, 30 October 2010 11:46]

Report message to a moderator

Re: [Acceleo] "Selection does not contain a main type ..." [message #636316 is a reply to message #636283] Sat, 30 October 2010 19:37 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050402050108010609060706
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

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)? Do you have a "xxx.java" file
generated right beside the "xxx.mtl" file you're trying to launch?

If yes to both ... Could you provide me with the version of Eclipse and
Acceleo you're trying this with?

Laurent Goubet
Obeo

Yannick Duchene (Hibou57) wrote:
> This work temporarily if I restart with a new workspace, but after some
> time, Acceleo ends to be always back to the above error.
>
> Am I the only one with this bug ?
>
> I suspected something in the Preferences, but there is no entry for
> Acceleo there.
>


--------------050402050108010609060706
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------050402050108010609060706--
Re: [Acceleo] "Selection does not contain a main type ..." [message #636318 is a reply to message #636316] Sat, 30 October 2010 20:23 Go to previous message
Yannick Duchene (Hibou57) is currently offline Yannick Duchene (Hibou57)Friend
Messages: 50
Registered: September 2010
Location: Metz (France - Europe)
Member
Hi Laurent Razz

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
Previous Topic:[Acceleo] null in [let] variables
Next Topic:[Acceleo] Error log with not caption
Goto Forum:
  


Current Time: Thu Apr 25 03:39:40 GMT 2024

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

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

Back to the top