Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Unable to generate code
Unable to generate code [message #1701675] Tue, 14 July 2015 20:46 Go to next message
Beat Lussi is currently offline Beat LussiFriend
Messages: 10
Registered: February 2015
Junior Member
Hi

I have the problem with my generation process. In my project I use an Acceleo UI Launcher. It works as expected if I run it in Eclipse as a new Eclipse Application but it doesn't work if I install it into the host. I can find in the log the following:

!ENTRY org.eclipse.acceleo.engine 2 0 2015-07-14 22:19:51.248
!MESSAGE The generation failed 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. It could also come from a missing [comment @main/] 
in the template used as the entry point of the generation. 


The comment main is within my main module. The packages are registered as followed (Generate.java):
/**
     * This can be used to update the resource set's package registry with all needed EPackages.
     * 
     * @param resourceSet
     *            The resource set which registry has to be updated.
     * @generated NOT
     */
    @Override
    public void registerPackages(ResourceSet resourceSet) 
    {
        super.registerPackages(resourceSet);
        if (!isInWorkspace(MyProjectPackage.class)) 
        {
            // The normal package registration if your metamodel is in a plugin.
            resourceSet.getPackageRegistry().put(MyProjectPackage.eNS_URI, MyProjectPackage.eINSTANCE);
        }
    }

    /**
     * This can be used to update the resource set's resource factory registry with all needed factories.
     * 
     * @param resourceSet
     *            The resource set which registry has to be updated.
     * @generated NOT
     */
    @Override
    public void registerResourceFactories(ResourceSet resourceSet) 
    {
        super.registerResourceFactories(resourceSet);

resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("myproject", new XMIResourceFactoryImpl());
    }


I work with Eclipse Luna SR1 4.4.1 and Acceleo 3.4.1.

Thanks a lot & BR
Re: Unable to generate code [message #1742930 is a reply to message #1701675] Thu, 08 September 2016 15:40 Go to previous message
pere joseph rodríguez is currently offline pere joseph rodríguezFriend
Messages: 12
Registered: October 2014
Junior Member
You can just use the main template as the entry point of an execution, that should be the problem
Previous Topic:[Acceleo] Dynamic Template Plugin
Next Topic:Dynamic profile not detected on second maven execution
Goto Forum:
  


Current Time: Tue Nov 13 03:07:05 GMT 2018

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

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

Back to the top