Re: [Acceleo] Invalid attributes during template invocation [message #1015015 is a reply to message #1014849] |
Wed, 27 February 2013 08:22 |
|
Michael,
Quote:eProxyURI: platform:/plugin/org.example.mm0/model/mm0.ecore#//Z/Attr0
That would mean that what you registered
Quote:getURIMap.put(platformURI, NsUri)
does not correspond to the real URI : "platformURI", here, needs to be what you see as the "eProxyURI" (platform:/plugin/org.example.mm0/model/mm0.ecore). Can you double-check that?
Laurent Goubet
Obeo
|
|
|
|
|
|
Re: [Acceleo] Invalid attributes during template invocation [message #1015598 is a reply to message #1015389] |
Fri, 01 March 2013 10:37 |
|
Michaël,
Just double-checked from my end ... Seems like I had done something else when tinkering with your samples, since it indeed does not work. EMF will not use the normalized URI when checking if an URI is that of an ePackage in the resource resolution process.
So the only workaround for this is to change the way your models reference themselves, i.e. open "mm1.ecore" textually, and replace occurences of "platform:/plugin/org.example.mm0/model/mm0.ecore" with "http://example.org/mm0" (leave the fragments "#..." intact, only change the ecore URI). Ed mentionned that
Quote:href="http://www.eclipse.org/ocl/XBNF#//Syntax/grammars" is wrong. ... but that is exactly how EMF references metamodels, and it makes use of a specific handling for such URIs (which is part of why your use case is failing).
The only impact you will see after having done this is that when you open "mm1.ecore" in the ecore editor, you will not "see" a tree node for the "mm0" resource. It will remain hidden. That is the only change : you will still be able to reference parts of that other metamodel, you will still be able to edit and save your model. Once you've change the platform URI once, you won't have to do it again after edits. You will also need to recompile the mtl file since the references there will react to the change in mm1 too.
As I previously mentionned, we can implement changes in Acceleo to allow for this uses case without forcing this cumbersome workaround on you, but that is not a planned change yet.
Laurent Goubet
Obeo
|
|
|
Re: [Acceleo] Invalid attributes during template invocation [message #1016033 is a reply to message #1015598] |
Mon, 04 March 2013 16:20 |
Michaël Melchiore Messages: 47 Registered: April 2012 |
Member |
|
|
Laurent,
The proposed fix prevents me from reloading the "mm1.genmodel" file. I get the following exception:
java.lang.reflect.InvocationTargetException
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:121)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1008)
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard.performFinish(ModelConverterWizard.java:246)
at org.eclipse.emf.importer.ui.contribution.base.ModelImporterWizard.performFinish(ModelImporterWizard.java:157)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:254)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:274)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Caused by: org.eclipse.core.runtime.CoreException: An error occurred while performing this operation.
at org.eclipse.emf.common.util.DiagnosticException.toCoreException(DiagnosticException.java:47)
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard$1.execute(ModelConverterWizard.java:235)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
... 51 more
Caused by: org.eclipse.emf.common.util.DiagnosticException: An error occurred while performing this operation.
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard$1.execute(ModelConverterWizard.java:234)
... 54 more
Caused by: java.io.IOException: PUT failed with HTTP response code 503
at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl$1.close(URIHandlerImpl.java:129)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1223)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:980)
at org.eclipse.emf.importer.ModelImporter.saveGenModelAndEPackages(ModelImporter.java:769)
at org.eclipse.emf.importer.ui.contribution.base.ModelImporterWizard.doPerformFinish(ModelImporterWizard.java:150)
at org.eclipse.emf.converter.ui.contribution.base.ModelConverterWizard$1.execute(ModelConverterWizard.java:228)
... 54 more
[Updated on: Mon, 04 March 2013 16:34] Report message to a moderator
|
|
|
Re: [Acceleo] Invalid attributes during template invocation [message #1016048 is a reply to message #1016033] |
Mon, 04 March 2013 17:41 |
Michaël Melchiore Messages: 47 Registered: April 2012 |
Member |
|
|
The proposed fix does solve my problem on a confined test case: a specific generator of my framework ported to Acceleo 3.
But, as I said in my previous port, the "URI switch" also prevents every directly or indirectly depending genmodel from being synchronized w.r.t to their metamodels.
I think Acceleo 3 could improve on the issues my team currently faces when maintaining or adding features in our software. Currently, I have small internal test projects which I use to build a more educated opinion on your technology. Ideally, I would like Acceleo 3 to support the next major release of our framework.
Considering the issues I keep running into since last year, I am growing more and more hesitant to port more ambitious code generators....
For now, the trick is to apply the "URI switch" after all genmodel have been synchronized and model java classes generated
[Updated on: Mon, 04 March 2013 17:44] Report message to a moderator
|
|
|
Re: [Acceleo] Invalid attributes during template invocation [message #1016155 is a reply to message #1016048] |
Tue, 05 March 2013 09:42 |
|
Michael,
Changing the URI "textually" did not prevent me from doing anything with the model, I must admit I did not test with a genmodel, though I do not really understand why that would fail.
As mentionned, this is something Acceleo can fix. I only tried to find a workaround you could use for now, seems like there aren't any viable ones.
Laurent Goubet
Obeo
|
|
|
|
Re: [Acceleo] Invalid attributes during template invocation [message #1016442 is a reply to message #1016383] |
Wed, 06 March 2013 13:25 |
Michaël Melchiore Messages: 47 Registered: April 2012 |
Member |
|
|
Stephane,
I have installed the integration update site, upgrading my Acceleo installtion from 3.3.2 to 3.4.x. I have also followed your advice and taken special care of my metamodel dependencies. Here is my dependency structure
MM1 (contained in an installed plugin)
MM2 (in workspace)
requires MM1
MM3 (in workspace)
requires MM2, MM1
MM3.m2t (in workspace)
requires MM3
Now, I get compile time errors in the editors: every use of Attr1 et Attr2 is detected as an "Unrecognized variable" error. I still think this is an improvement because errors are now detected before runtime and reliably (every use of Attr1 and Attr2 in every project triggers an error).
A small question: in your template, you have referenced all three metamodels. Am I correct to think that only MM3 is required (provided all dependencies are properly set in plugins) ?
Regards,
Michaël
[Updated on: Wed, 06 March 2013 16:14] Report message to a moderator
|
|
|
|
|
Re: [Acceleo] Invalid attributes during template invocation [message #1017780 is a reply to message #1017762] |
Tue, 12 March 2013 14:26 |
|
Hi again,
So the use case where I could reproduce your issue involved the following situation. We are loading mm3 since it is a project dependency of our project (using the MANIFEST.MF) located in the workspace, but mm3 is referencing mm2 with the following relative path "../../mm2/model/mm2.ecore" whle we had loaded mm2 thanks to the following workspace relative path (/mm2/model/mm2.ecore), in a similar fashion we could have a problem finding mm1. This fix improves the consistency of our own package registry regarding metamodels in the workspace with dependencies to other metamodels. The new fix also improves Ctrl+click on attributes, references and variable declarations for types located in metamodels in the workspace (in my previous screenshot, Ctrl+clicking on 'AttrX' and 'aC : C').
The new build can be found on this update site. Tell me if this new build fixes all your problems regarding to this situation. Thanks.
Regards,
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks
|
|
|
|
|
Re: [Acceleo] Invalid attributes during template invocation [message #1017825 is a reply to message #1017800] |
Tue, 12 March 2013 15:54 |
|
Hi,
This fix will be available in Acceleo 3.4.0 which will be release at the end of June. I will backport it on Acceleo 3.3 to make a new release for Acceleo 3.3.3 this week. If you need this fix as soon as possible, you can use the integration build of Acceleo 3.4.0 that I gave you since it contains almost no changes from Acceleo 3.3.2 released last month. We have just changed the way, Acceleo modules wrapping Java services are automatically generated by the new module wizard (nothing to worry about for your need here). If it's not critical, you could wait for Acceleo 3.3.3 which should be released this week. Given the minimal difference between the two version, I would personnaly just use the integration build of Acceleo 3.4.0.
Regards,
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 5.06144 seconds