Home » Modeling » M2T (model-to-text transformation) » parameter of the main template is a proxy(getting all the time the following error: parameter of the main template is a proxy)
parameter of the main template is a proxy [message #1006021] |
Tue, 29 January 2013 10:15  |
Eclipse User |
|
|
|
Hey!!
I am developeng an Acceleo project. It works perfectly when i launch it from eclipse as Acceleo plugin. Whenever i export it as a plugin and then install to eclipse, or try to launch as a Java application I am getting the following exception: the first parameter of the main template is a proxy. May be the tricky part here is that i use the meta-model which is defined in another plugin. So my plugin has that one in dependencies.
As it works when I launch it as Acceleo plugin from Eclipse, i assume, that there are no problems with my templates or models. Probably some dependencies trouble?
What may be wrong? I am trying to fix this for several days so far reading your forums, doesnt really help.
Is there any possibility to see the detailed log, what is not initialized, when this proxy happens?
Dont see any errors, while debugging. Why doesnt it throw any exception, when smth is initialized as proxy if its so critical for further work?
Please help!!
Thanx
|
|
|
Re: parameter of the main template is a proxy [message #1006074 is a reply to message #1006021] |
Tue, 29 January 2013 13:04   |
Eclipse User |
|
|
|
May be its also a problem with packages manual registration.
Please suggest me what should be there in the packages registration function. I am attaching my model screenshot. Btw, the model uri doesnt start with "http". Could it be the reason?
Here is now what i have in the package registration function at the moment:
if (!isInWorkspace(LibraryElementPackage.class))
{
resourceSet.getPackageRegistry().put(LibraryElementPackage.eNS_URI,
LibraryElementPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(DataPackage.eNS_URI, DataPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(UiPackage.eNS_URI, UiPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(PalettePackage.eNS_URI, PalettePackage.eINSTANCE);
resourceSet.getPackageRegistry().put(VirtualDNSPackage.eNS_URI, DataPackage.eINSTANCE);
}
here is registerResourceFactories (not sure what i should put here, please guide me. My model files are initially with "XML" extension and contain XMI inside)
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new LibraryElementResourceFactoryImpl());
Attachment: model.png
(Size: 42.23KB, Downloaded 398 times)
|
|
|
Re: parameter of the main template is a proxy [message #1006125 is a reply to message #1006074] |
Wed, 30 January 2013 00:34   |
Eclipse User |
|
|
|
Veronika,
Proxies are generally the result of cross document references within the
instances themselves that fail to resolve. It's unlikely to be caused
by missing package registrations. A more likely cause stems from the URI
you're trying to use to load the instances, but you've said nothing
about that. In particular, if you don't use an absolute URI, e.g,.
platform:/resource/... or file:/c:/... any serialized references that
use relative paths will fail to resolve...
On 29/01/2013 7:04 PM, veronika domova wrote:
> May be its also a problem with packages manual registration.
> Please suggest me what should be there in the packages registration function. I am attaching my model screenshot. Btw, the model uri doesnt start with "http". Could it be the reason?
>
> Here is now what i have in the package registration function at the moment:
>
> if (!isInWorkspace(LibraryElementPackage.class))
> {
> resourceSet.getPackageRegistry().put(LibraryElementPackage.eNS_URI,
> LibraryElementPackage.eINSTANCE);
>
> resourceSet.getPackageRegistry().put(DataPackage.eNS_URI, DataPackage.eINSTANCE);
> resourceSet.getPackageRegistry().put(UiPackage.eNS_URI, UiPackage.eINSTANCE);
> resourceSet.getPackageRegistry().put(PalettePackage.eNS_URI, PalettePackage.eINSTANCE);
> resourceSet.getPackageRegistry().put(VirtualDNSPackage.eNS_URI, DataPackage.eINSTANCE);
> }
>
> here is registerResourceFactories (not sure what i should put here, please guide me. My model files are initially with "XML" extension and contain XMI inside)
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new LibraryElementResourceFactoryImpl());
|
|
| |
Re: parameter of the main template is a proxy [message #1006199 is a reply to message #1006195] |
Wed, 30 January 2013 07:33   |
Eclipse User |
|
|
|
Veronika,
Without knowing what your instances look like (i.e., their serialized
XML), what the cross references look like (i.e., the hrefs in the XML),
what URIs you use to load the instances (I've already asked about
those), nor even a stack trace (always include one in your question when
you say there is one), there's really nothing anyone can do to help you...
On 30/01/2013 1:22 PM, veronika domova wrote:
> Hey again!!
>
> I just noticed that, if the model project is also open as a project in the workspace, then acceleo plugin application launch works perfectly. But if i close the project, everything still compiles, but the acceleo plugin application launch gives me the proxy error [notice please that its not even JAVA launch]. The model plugin is already installed to Eclipse. Seems that Acceleo doesnt see it when launching the app, but it saw it perfectly when i was creating the project.. Why?
>
> Attaching the screenshot as well
>
>
|
|
| | | | | | | | |
Re: parameter of the main template is a proxy [message #1011796 is a reply to message #1006294] |
Wed, 20 February 2013 04:19  |
Eclipse User |
|
|
|
And once again, can we go back to the initial problem instead of going to the standaloneprojectmap and whatnot?
> It works perfectly when i launch it from eclipse as Acceleo plugin.
This is expected, since in such a case you benefit from the registrations made by EMF and other plugins.
> the first parameter of the main template is a proxy
As Ed Merks mentionned, this is due to the resolution of some references failing. However, contrarily to what he mentions afterwards, this _is_ more often that not due to a failure in resolving a metamodel (a missing or incorrect package registration). Acceleo modules are models themselves; their own metamodel is resolved (since it is Acceleo itself). However, the "target" metamodel of your transformation is the culprit. In this case, you "target" a metamodel which NsURI should be org.fordiac.ide.model because of your module's signature : [module generate('org.fordiac.ide.model')].
Is that the actual NsURI of your model? If yes, it should also be what's returned by a call to LibraryElementPackage.eNS_URI. Otherwise, your registering of resourceSet.getPackageRegistry().put(LibraryElementPackage.eNS_URI, LibraryElementPackage.eINSTANCE); is incorrect.
You also seem to have the project containing your metamodel both as a project in your workspace and as an installed arteface in your current Eclipse. This is rarely a good idea. You might want to close/remove the project, restart your eclipse, then try re-compiling your acceleo modules. That should make for better serialized URLs from EMF.
Laurent Goubet
Obeo
|
|
|
Goto Forum:
Current Time: Wed Jul 23 07:38:53 EDT 2025
Powered by FUDForum. Page generated in 0.21891 seconds
|