[Acceleo] Problem invoke java service [message #975373] |
Wed, 07 November 2012 20:46 |
Guillaume Lincé Messages: 6 Registered: November 2012 |
Junior Member |
|
|
Hello,
I'm using Acceleo to generate HTML5/CSS3 from two models. These two models are conform to ecore meta-models. I'm giving the first Model element (root element of the first model) to my main template. For the second one, I'm trying to invoke a java service that gets the Model element (a FCSSModel). When I'm running the java method normally, I get the correct result but when I try to invoke it using a query in acceleo, I get this error:
java.lang.NoClassDefFoundError: be/ac/fundp/info/fCSS/FCSSModel
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.findInvokeMethod(AcceleoLibraryOperationVisitor.java:891)
at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.invoke(AcceleoLibraryOperationVisitor.java:1176)
at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.callNonStandardOperation(AcceleoLibraryOperationVisitor.java:133)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1213)
at org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:390)
at org.eclipse.ocl.AbstractEvaluationVisitor.visitExpression(AbstractEvaluationVisitor.java:248)
at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(EvaluationVisitorDecorator.java:156)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1887)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1042)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoQueryInvocation(AcceleoEvaluationVisitor.java:872)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1864)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1042)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoLetBlock(AcceleoEvaluationVisitor.java:660)
at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1870)
Here is the code of my module where I invoke the java service:
[comment encoding = UTF-8 /]
[module generate('FCSS ecore URI')/]
[query public getFCSSModel(filePath:String) : FCSSModel
= invoke('TVLtoHTML5.main.FCSSModelGetter', 'getFCSSModel(java.lang.String)', Sequence{filePath}) /]
Here is how I call the query (in the main template):
[module generateConfigurator('TVL ecore URI','FCSS ecore URI')]
...
[let fcssModel:FCSSModel = '/Users/GLince/workspace/TVLtoHTML5/tvlFiles/tune.fcss'.getFCSSModel()]
[fcssModel.imp.importURI/]
[/let]
I also tried a really simple java service which just returns true to see if the invoke method was working and it was.
From the error's look, it seems it doesn't find the FCSS meta-model or something like that but I don't know why since the URI is specified in each module file.
Do you know where the error could be from?
Thanks for your help,
Guillaume
|
|
|
Re: [Acceleo] Problem invoke java service [message #975993 is a reply to message #975373] |
Thu, 08 November 2012 08:27 |
|
Guillaume,
Judging by the error message, the most likely cause is that you do not have an explicit dependency between the project containing your Acceleo module and the project containing the java service. Another possibility would be that the latter does not "export" the package containing the Java service and/or the package containing the "be.ac.fundp.info.fCSS.FCSSModel" class.
Laurent Goubet
Obeo
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03891 seconds