Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3.1.0] Module file (.mtl) is not built into a .java file
[Acceleo 3.1.0] Module file (.mtl) is not built into a .java file [message #691676] Sat, 02 July 2011 02:43 Go to next message
Tomas Balderas is currently offline Tomas BalderasFriend
Messages: 64
Registered: July 2010
Member
I switched from Helios to Indigo due to Papyrus compatibility issues. When I tried to build a new Acceleo module in this environment (Eclipse Indigo Release Build 20110615-0604 and Acceleo 3.1.0.v20110607-0602) I noticed that the .mtl file of my module was never built into a .java file as in the Helios version.

The option Project->Build Automatically has been activated all the time since installation. I changed the execution environment from J2SE-1.5 to JavaSE-1.6 in the "Properties for JRE System Library" dialog box and in the MANIFEST.MF file until no warning concerning to the incompatibility between J2SE-1.5 and JavaSE-1.6 appeard. But the .mtl file is still not built and the message "Selection does not contain a main type (@main annotation is missing in your main template)" keeps appearing when trying to run the template.

Does any of you have any suggestion to fix this problem?

Also, are Papyrus and Acceleo compatible? I am a newcomer and plan to use them both in my project.

Thanks a lot in advance. Kindest regards.



/TB
Re: [Acceleo 3.1.0] Module file (.mtl) is not built into a .java file [message #692238 is a reply to message #691676] Mon, 04 July 2011 02:32 Go to previous messageGo to next message
Tomas Balderas is currently offline Tomas BalderasFriend
Messages: 64
Registered: July 2010
Member
I hope you can help me know, please. I am using Indigo Release Build id: 20110615-0604. In the dialog box "Generate a new Acceleo generation project" I checked the boxes labeled "Generate file" and "Main template" and set the metamodel to "http://www.eclipse.org/uml2/3.0.0/UML". Once the project is generated I se that the .java file associated to my .mtl file has been built. However, after making any change to the .mtl file the corresponded .java file indicates the following errors:

org.eclipse.uml2 cannot be resolved to a type
org.eclipse.uml2.uml.UMLPackage cannot be resolved to a type
The method isInWorkspace(Class<? extends EPackage>) in the type AbstractAcceleoGenerator is not applicable for the arguments (Class<UMLPackage>)

I have installed the following plug-in:

UML2 Extender SDK 3.2.0.v201105231350 org.eclipse.uml2.sdk.feature.group Eclipse Modeling Project

Did I miss installing anything? How can I fix my problem?

Thanks a lot. Kindest regards.


/TB
Re: [Acceleo 3.1.0] Module file (.mtl) is not built into a .java file [message #692332 is a reply to message #692238] Mon, 04 July 2011 08:46 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

In Acceleo 3, the Java launcher is created to launch any templates with the following comment [comment @main/]. If you don't have this comment, the Java launcher will not be created. You need to ask to create a main module in the Acceleo wizard to have it in your template (by using the Acceleo Main Module Wizard or by checking the box "main" in the regular Acceleo wizard). If you remove this comment, the Java file will not deleted but it will not de synchronized anymore with the main module. Don't forget to export the package containing the main template too in the MANIFEST.MF (tab runtime). For more information, you can have a look at the Acceleo user guide and at the Best practices guide on the Obeo Network.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [Acceleo 3.1.0] Module file (.mtl) is not built into a .java file [message #692547 is a reply to message #692332] Mon, 04 July 2011 17:49 Go to previous messageGo to next message
Tomas Balderas is currently offline Tomas BalderasFriend
Messages: 64
Registered: July 2010
Member

Thank you for your kind reply Stephane. I am basically following this tutorial http://wiki.eclipse.org/Acceleo/Getting_Started with what seems to be a recent Acceleo release (3.1.0 and Eclipse Indigo for x86-64 in Windows 7). I failed the first time because the .java file asociated with the file generate.mtl was not generated automatically. The second time, I generated the project by checking the boxes labeled "Generate file" and "Main template" and then I got the following error messages in the file Generate.java:

org.eclipse.uml2 cannot be resolved to a type
org.eclipse.uml2.uml.UMLPackage cannot be resolved to a type
The method isInWorkspace(Class<? extends EPackage>) in the type AbstractAcceleoGenerator is not applicable for the arguments (Class<UMLPackage>)

In my third attempt I made sure to check "Generate file" and "Main template". This time I checked the file META-INF/MANIFEST.MF and noticed that the package containing the file generate.mtl (org.eclipse.acceleo.module.sample.main) had already been exported. However the file Generate.java still has the issues above.

I want to point out that in Acceleo 3.0.2 running in Eclipse Helios for Mac OS X (PowerPC and Leopard) I have not had any problem.


/TB
Re: [Acceleo 3.1.0] Module file (.mtl) is not built into a .java file [message #692819 is a reply to message #692547] Tue, 05 July 2011 09:56 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Do you have a dependency with the uml project? Have a look at your MANIFEST.MF file and in the 'dependencies' tab, you should have "org.eclipse.uml2.uml" has a dependency. This is the Eclipse bundle that contains the UML metamodel and it is required to generate.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [Acceleo 3.1.0] Module file (.mtl) is not built into a .java file [message #693047 is a reply to message #692819] Tue, 05 July 2011 17:16 Go to previous message
Tomas Balderas is currently offline Tomas BalderasFriend
Messages: 64
Registered: July 2010
Member

Stephane

I included a dependency on "org.eclipse.uml2.uml" in the file MANIFEST.MF and that fixed my problem. I think I will not have any problem like this anymore.

I really appreciate your help and your patience Very Happy

Kindest regards.


/TB
Previous Topic:[Acceleo] - Problem with Java Application runner
Next Topic:[Acceleo] Retrieve a Class : from an association in a property / from her name in the model
Goto Forum:
  


Current Time: Thu Apr 25 21:45:50 GMT 2024

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

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

Back to the top