Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a (Issues with the Acceleo 3.1.0 version)
icon5.gif  Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #673668] Tue, 24 May 2011 08:41 Go to next message
Rainer Menke is currently offline Rainer Menke
Messages: 6
Registered: July 2009
Junior Member
I have written a transformation in Acceleo, which uses xml as input. For this I wrote the required contenthandler and everthing else. The transformation works fine in the version 3.1.0M6a.

I haven't changed handling for the xml files, nor the templates for Acceleo. The main template is defined as

[comment encoding = UTF-8 /]
[module generate('xxx')/]
[...]

[template public generate(w : WebType)]
[for( m0 : MenuType | w.menu )]
[generateMenu(m0,w)/]

and the implementation of the Generator is given as:

public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
// TODO If you need additional package registrations, do them here. The following line is an example for UML.
if (!isInWorkspace(WebmlPackage.class)) {
// The normal package registration if your metamodel is in a plugin.
resourceSet.getPackageRegistry().put(WebmlPackage.eNS_URI, WebmlPackage.eINSTANCE);
} else {
// The package registration that will be used if the metamodel is not deployed in a plugin.
// This should be used if your metamodel is in your workspace.
resourceSet.getPackageRegistry().put("/de.malime.ecore.webml/model/webml.ecore", WebmlPackage.eINSTANCE);
}
}

with an xml file

<?xml version="1.0" ?>
<web theme="theme/malime.css" xmlns="xxxxx" >
<meta name="keywords" value="IBM,Rational Software,RSA,RSM,RFT,RTC,jazz.net,MDA,MBD,MDD,eclipse,plugins,features" />
....
</web>

Since Acceleo 3.1.0M7 I get the warning: "The generation fail to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates.
The problem may be caused by a problem with the registration of your metamodel, please see the method named "registerPackages" in the Java launcher of your generator."

Does somebody have any idea, what could be done or changes to resolve this issue?

TIA

Rainer Menke
Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #673955 is a reply to message #673668] Wed, 25 May 2011 05:28 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
Rainer,

This warning message is something we've added recently. You say you "get the warning" ... but are your files properly generated or did the generator really failed at generating anything?

There is one case where we log this warning even if the files have been generated, you could be in such a case.

Laurent Goubet
Obeo
Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #673966 is a reply to message #673955] Wed, 25 May 2011 06:30 Go to previous messageGo to next message
Rainer Menke is currently offline Rainer Menke
Messages: 6
Registered: July 2009
Junior Member
Hi Laurent,

nothing is generated. It seems like Acceleo is unable to resolve the proxy. I am just debugging it. In former version ( M7,RC1 of Acceleo 3.1.0 ) I got the message that the main template generate( null ) could not be found. Now, I do not see this error any longer. Perhaps it is true anyway, perhaps some implementation errors, but in the later case I do not understand why it has worked in M6a.

I added soe of the debug info, but it seems like the defined "language constructs" could not be resolved:

module generate(org.eclipse.acceleo.model.mtl.impl.TypedModelImpl@6c646c64)

[generate(null)]

in contrast to the emtl-file

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" [...] >
<mtl:Module name="generate" nsURI="de::malime::acceleo::webmenu::files::generate" startHeaderPosition="29" endHeaderPosition="75">
<input>
<takesTypesFrom href="webml#/"/>
</input>
<imports href="generateMenu.emtl#/0"/>
<imports href="generateSubmenu.emtl#/0"/>
<imports href="generateSubsubmenu.emtl#/0"/>
<imports href="common.emtl#/0"/>
<ownedModuleElement xsi:type="mtl:Template" name="generate" visibility="Public">
[...]
<parameter name="w">
<eType xsi:type="ecore:EClass" href="webml#//WebType"/>
</parameter>
</ownedModuleElement>

TIA

Rainer

[Updated on: Wed, 25 May 2011 12:20]

Report message to a moderator

Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #675151 is a reply to message #673966] Mon, 30 May 2011 08:37 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

In Acceleo 3.1.0M7 we have introduced several new features in Acceleo. You may want to try first with Acceleo 3.1.0 RC2.
- Does you project use binary or xmi serialization ? (right click on the project -> properties -> acceleo).

(if binary, switch to xmi since it is easier to debug)

From this "/de.malime.ecore.webml/model/webml.ecore", I imagined that your metamodel is in your workspace. If it is the case, you should try to remove the "!isInworkspace" with the xmi resource serialization.
If you want to use binary resources, you will have to register "/de.malime.ecore.webml/model/webml.ecore" but again try to remove the "!isInWorkspace".

If you are working with a metamodel in the workspace, try to use xmi resource serialization since it will allow you to use the regular registration: (resourceSet.getPackageRegistry().put(WebmlPackage.eNS_URI, WebmlPackage.eINSTANCE)).

Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com




Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #675411 is a reply to message #675151] Tue, 31 May 2011 08:47 Go to previous messageGo to next message
Rainer Menke is currently offline Rainer Menke
Messages: 6
Registered: July 2009
Junior Member
Hi Stephane,

sorry for the delay in my reply. I have tested Acceleo 3.1.0 M7 up to Acceleo 3.1.0 RC2. The issues are the same. I have even tried both serializations. I have deleted the line !isInWorkspace. The are two scenarios. One is given with the metamodel als project ( de.malime.ecore.webml/model/webml.ecore ) in the other case the metamodel is deployt as a bundle. I haven't tried eclipse 3.7 RC2 but I am using IBM RSA 8.0.2.

TIA

Rainer Menke
Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #676196 is a reply to message #675411] Fri, 03 June 2011 03:29 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" [...] >
<mtl:Module name="generate" nsURI="de::malime::acceleo::webmenu::files::generate" startHeaderPosition="29" endHeaderPosition="75">
<input>
<takesTypesFrom href="webml#/"/>
</input>


The uri of your metamodel is "webml" ?
Do you have the same uri in your input model ?
Are you registering your metamodel with the same uri in Eclipse ?
The Launcher Class Generated by Acceleo has two constructors, one which takes the uri of your metamodel, the other one which takes the already loaded model. You should try to use ModelUtils.load(...) to load manually your model and check if the metamodel is correctly resolved. Just like we do it with AbstractAcceleoGenerator#initialize(...) line 415 and line 416.

Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com



Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #686566 is a reply to message #676196] Wed, 22 June 2011 10:02 Go to previous messageGo to next message
Rainer Menke is currently offline Rainer Menke
Messages: 6
Registered: July 2009
Junior Member
Hi Stephane,

sorry for the long delay in my reply. I removed the complete line

[comment @main]

from the main template mtl. This was one issue, which leads to the message

!MESSAGE The generation fail to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates.
The problem may be caused by a problem with the registration of your metamodel, please see the method named "registerPackages" in the Java launcher of your generator.

Based on the fact, that is seems to be a "layer 8 problem", perhaps it would be useful, if the [comment ...] would be remaned in something like [precond ...] because comment seems to be something deletable Wink .

Due to the fact i regenerated the resource relevant parts, I must doublecheck, if the behaviour is fixed with all my ResourceFactories.

Thanks for your hints

Rainer Menke
Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #687858 is a reply to message #686566] Thu, 23 June 2011 08:13 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Rainer Menke wrote on Wed, 22 June 2011 16:02

Based on the fact, that is seems to be a "layer 8 problem", perhaps it would be useful, if the [comment ...] would be remaned in something like [precond ...] because comment seems to be something deletable Wink .


Hi,

We choose to use "comment" because the MOFM2T specification does not define the "entry point" of the generation. This comment defines the main template while keeping Acceleo conform to the OMG's standard but I agree with you, it is one of those thinks that would need to be in the specification and not defined as a comment.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #741682 is a reply to message #687858] Wed, 19 October 2011 15:55 Go to previous messageGo to next message
Jean-Francois Brazeau is currently offline Jean-Francois Brazeau
Messages: 4
Registered: November 2010
Junior Member
Hello,

Today I worked on an Acceleo project that had been built with Eclipse Helios (Acceleo 3.0.2). It seems that the @main comment wasn't required with Acceleo 3.0.2 because my templates used to work correctly in my helios environment.

When I imported my template project in an Indigo workspace, I met the same error message as Rainer Menke and I must admit that it gave me a headache to understand the source of the problem.

Maybe the error message could be more explicit in Acceleo ? Actually, the error message talks about a problem of registered packages, or template argument type.

Maybe would it be possible just to specify that the problem may *also* come from a missing @main comment ?

Regards,

JF. Brazeau
Re: Generation with Acceleo failed since 3.1.0M7 but worked for 3.1.0M6a [message #743166 is a reply to message #741682] Fri, 21 October 2011 03:28 Go to previous message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Quote:
Maybe would it be possible just to specify that the problem may *also* come from a missing @main comment ?


I've updated the message for Acceleo 3.2.0

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Previous Topic:[Xpand] Using dynamic emf metamodel with Xpand
Next Topic:[acceleo 3.2] dependency problem with jar
Goto Forum:
  


Current Time: Sat Aug 30 06:37:49 EDT 2014

Powered by FUDForum. Page generated in 0.01977 seconds