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)
|
Re: parameter of the main template is a proxy [message #1006074 is a reply to message #1006021] |
Tue, 29 January 2013 18:04 |
veronika domova Messages: 7 Registered: January 2013 |
Junior Member |
|
|
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 336 times)
|
|
|
Re: parameter of the main template is a proxy [message #1006125 is a reply to message #1006074] |
Wed, 30 January 2013 05:34 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
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());
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: parameter of the main template is a proxy [message #1006199 is a reply to message #1006195] |
Wed, 30 January 2013 12:33 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
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
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | | | | | | |
Re: parameter of the main template is a proxy [message #1011796 is a reply to message #1006294] |
Wed, 20 February 2013 09:19 |
|
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: Fri Apr 26 13:56:19 GMT 2024
Powered by FUDForum. Page generated in 0.04865 seconds
|