Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » org.eclipse.acceleo.engine.AcceleoEvaluationException(The type of the first parameter of the main template named 'generateElement' is a proxy.)
org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1431349] Thu, 25 September 2014 15:12 Go to next message
Robert Lario is currently offline Robert LarioFriend
Messages: 34
Registered: July 2009
Member
Here is the exception: Exception in thread "main" org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the first parameter of the main template named 'generateElement' is a proxy.
at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:632)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:211)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:172)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:159)
at com.att.itos.workflow.acceleco.test1.common.Generate.doGenerate(Generate.java:206)
at com.att.itos.workflow.acceleco.test1.common.Generate.main(Generate.java:164)


This is where it is thrown:

Class:
Method : doGenerate

Here is where the exception is thrown:

if (argumentType.eIsProxy()) {
throw new AcceleoEvaluationException(AcceleoEngineMessages.getString(
"AcceleoService.TypeIsProxy", templateName)); //$NON-NLS-1$
}


argumentType is :

org.eclipse.emf.ecore.impl.EClassImpl@2d5534 (eProxyURI: file:/C:/Users/rl8840/WorkspaceATT2/com.att.itos.workflow.acceleco.test1/bin/com/att/itos/workflow/acceleco/test1/common/www.att.com/WorkflowScreenModel#//UserStory)

I dont understand why it is a eProxyURI, which is causing the exception to be thrown.
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1431386 is a reply to message #1431349] Thu, 25 September 2014 16:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7266
Registered: July 2009
Senior Member
Hi

You haven't registered something.

"file:/C:/Users/rl8840/WorkspaceATT2/com.att.itos.workflow.acceleco.test1/bin/com/att/itos/workflow/acceleco/test1/common/www.att.com/WorkflowScreenModel#//UserStory"

looks suspiciously like a couple of names that are sensible to you
joined together to give rubbish and consequently a load failure and
downstream proxies to the load failure.

For simple cases the comments in the autogenerated Acceleo template tell
you what to do. Do as you are told and if necessary practice on a simple
autogenerated example.

For complex cases, welcome to the Java debugger and the eccentricities
of Acceleo URI resolution.

Regards

Ed Willink




On 25/09/2014 16:12, Robert Lario wrote:
> Here is the exception: Exception in thread "main"
> org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the
> first parameter of the main template named 'generateElement' is a proxy.
> at
> org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:632)
>
> at
> org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:211)
>
> at
> org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:172)
>
> at
> org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:159)
>
> at
> com.att.itos.workflow.acceleco.test1.common.Generate.doGenerate(Generate.java:206)
>
> at
> com.att.itos.workflow.acceleco.test1.common.Generate.main(Generate.java:164)
>
>
>
> This is where it is thrown:
> Class:
> Method : doGenerate
>
> Here is where the exception is thrown:
>
> if (argumentType.eIsProxy()) {
> throw new
> AcceleoEvaluationException(AcceleoEngineMessages.getString(
> "AcceleoService.TypeIsProxy", templateName));
> //$NON-NLS-1$
> }
>
>
> argumentType is :
>
> mailto:org.eclipse.emf.ecore.impl.EClassImpl@2d5534 (eProxyURI:
> file:/C:/Users/rl8840/WorkspaceATT2/com.att.itos.workflow.acceleco.test1/bin/com/att/itos/workflow/acceleco/test1/common/www.att.com/WorkflowScreenModel#//UserStory)
>
>
> I dont understand why it is a eProxyURI, which is causing the exception
> to be thrown.
>
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1431438 is a reply to message #1431386] Thu, 25 September 2014 17:44 Go to previous messageGo to next message
Robert Lario is currently offline Robert LarioFriend
Messages: 34
Registered: July 2009
Member
Thank you for your reply.

Within my Generate class:

I have registered my meta model :

in the method registerResourceFactories I have placed:

resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("workflowscreenmodel", new WorkflowScreenModelResourceFactoryImpl());


and within the method I have :

resourceSet.getPackageRegistry().put(WorkflowScreenModel.WorkflowScreenModelPackage.eINSTANCE.getNsURI(), WorkflowScreenModel.WorkflowScreenModelPackage.eINSTANCE);

I dont understand where : "file:/C:/Users/rl8840/WorkspaceATT2/com.att.itos.workflow.acceleco.test1/bin/com/att/itos/workflow/acceleco/test1/common/www.att.com/WorkflowScreenModel#//UserStory"

is coming from.
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1431607 is a reply to message #1431386] Thu, 25 September 2014 23:24 Go to previous messageGo to next message
Robert Lario is currently offline Robert LarioFriend
Messages: 34
Registered: July 2009
Member
Ed,

I have gone around in circles on this issue.

I have created a very small example that generates the error. Please find it attached.

I have been registering my model as prescribed.

The attached example demonstrates the problem.

I greatly appreciate your help.

Robert

  • Attachment: example.zip
    (Size: 146.85KB, Downloaded 122 times)
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1431988 is a reply to message #1431607] Fri, 26 September 2014 12:45 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7266
Registered: July 2009
Senior Member
Hi

Perhaps the problem is that

#Import-Package: com.att.test.testbar.testModel,
com.att.test.testbar.testModel.util,

do not exist. I certainly can't help you without them.

Probably irrelevant, but I note an unconstrained import

com.google.guava

Make sure you only have version 15 available.

Regards

Ed Willink

On 26/09/2014 00:24, Robert Lario wrote:
> Ed,
>
> I have gone around in circles on this issue.
>
> I have created a very small example that generates the error. Please find it attached.
>
> I have been registering my model as prescribed.
>
> The attached example demonstrates the problem.
>
> I greatly appreciate your help.
>
> Robert
>
>
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1432013 is a reply to message #1431988] Fri, 26 September 2014 13:33 Go to previous messageGo to next message
Robert Lario is currently offline Robert LarioFriend
Messages: 34
Registered: July 2009
Member
Ed,

Sorry about the com.att.test.testbar stuff. I thought I had stripped that out. It is superfluous.

I checked com.google.guava and its version 15.

I have attached the corrected code.

Thanks for looking at this for me.

Robert



  • Attachment: example.zip
    (Size: 146.83KB, Downloaded 106 times)
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1434736 is a reply to message #1432013] Tue, 30 September 2014 14:00 Go to previous messageGo to next message
Robert Lario is currently offline Robert LarioFriend
Messages: 34
Registered: July 2009
Member
Hi Ed,

Are you seeing the same issue with the sample code I sent? Its a very simple model. I have not done anything special with the code. I created the model, generated the supporting code and attempted to create an acceleo template.

Robert
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1435551 is a reply to message #1432013] Wed, 01 October 2014 17:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7266
Registered: July 2009
Senior Member
Hi

You'll find it works a lot better if you

a) include your metamodel plugin on the classpath/projrct dependencies
- well worth Bugzilla for the opaque behaviour

b) don't use a URI such as 'example.com' that looks like a file name,
prefix with http://
- well worth another Bugzillaa.

Regards

Ed Willink

On 26/09/2014 15:33, Robert Lario wrote:
> Ed,
>
> Sorry about the com.att.test.testbar stuff. I thought I had stripped that out. It is superfluous.
>
> I checked com.google.guava and its version 15.
>
> I have attached the corrected code.
>
> Thanks for looking at this for me.
>
> Robert
>
>
>
>
Re: org.eclipse.acceleo.engine.AcceleoEvaluationException [message #1435608 is a reply to message #1435551] Wed, 01 October 2014 18:53 Go to previous message
Robert Lario is currently offline Robert LarioFriend
Messages: 34
Registered: July 2009
Member
argh. Embarrassed I have been stuck on this for weeks banging my head!!!
Thank you so much. I rebuilt my example using your advice and all work.
So frustrating!
Again thanks..
Previous Topic:[Acceleo] The type of the first parameter of the main template named 'generateElement' is a proxy
Next Topic:[Acceleo] How to build an Acceleo 3.4.1 project with Maven?
Goto Forum:
  


Current Time: Wed Sep 22 00:38:26 GMT 2021

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

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

Back to the top