I have getting the following pair of errors when attempting the example java service wrapper:
Invalid result for expression self.invoke('AcceleoServiceTest.service.Util', 'div(java.lang.Double, java.lang.Double)', Sequence {arg0, arg1}) at line 4 in Module utilQuery for query div(Real,Real). Last recorded value of self was org.eclipse.emf.ecore.impl.EPackageImpl@12875ac (name: Model) (nsURI: test, nsPrefix: ).
ERROR in (visitOperationCallExp): (Class AcceleoServiceTest.service.Util Couldn't be found in the classpath of the bundle containing module utilQuery.emtl.)
I am running Acceleo 3.1 under Eclipse Indigo
The enitre project consists of a generate.mtl template that uses the query, an EMF model with only a package in it as a stub and the query source/mtl. Everything else was created by the wizard that built the project as a standard Acceleo project.
What am I forgetting to do in order for the templates to be able to reference the Java file for an invoke? I have the package with the java file in it as both an inport and export package in the manifest.
Just so you have all the informaiton here's my MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Acceleo AcceleoServiceTest Module Runtime Plug-in
Bundle-SymbolicName: AcceleoServiceTest
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: AcceleoServiceTest.Activator
Bundle-Vendor: Eclipse Modeling Project
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xmi,
org.eclipse.ocl,
org.eclipse.ocl.ecore,
org.eclipse.acceleo.common;bundle-version="3.1.0",
org.eclipse.acceleo.parser;bundle-version="3.1.0",
org.eclipse.acceleo.model;bundle-version="3.1.0",
org.eclipse.acceleo.profiler;bundle-version="3.1.0",
org.eclipse.acceleo.engine;bundle-version="3.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Export-Package: AcceleoServiceTest.main,
AcceleoServiceTest.service
Import-Package: AcceleoServiceTest.main,
AcceleoServiceTest.service
Here's my generate.mtl
[comment encoding = UTF-8 /]
[**
* The documentation of the module generate.
*/]
[module generate('http://www.eclipse.org/emf/2002/Ecore', 'platform:/resource/AcceleoServiceTest/model/test.ecore')]
[import AcceleoServiceTest::service::utilQuery /]
[**
* The documentation of the template generateElement.
* @param aEPackage
*/]
[template public generateElement(aEPackage : EPackage)]
[comment @main/]
[file (aEPackage.name, false, 'UTF-8')]
[2.1.div(1.7)/]
[/file]
[/template]
here's the service java file
/**
*
*/
package AcceleoServiceTest.service;
public class Util
{
public Double div (Double a, Double b)
{
return a/b;
}
}
here's the generated utilQuery.mtl file
[comment encoding = Cp1252 /]
[module utilQuery('http://www.eclipse.org/acceleo/mtl/3.0', 'http://www.eclipse.org/emf/2002/Ecore')/]
[query public div(arg0 : Real, arg1 : Real) : Real
= invoke('AcceleoServiceTest.service.Util', 'div(java.lang.Double, java.lang.Double)', Sequence{arg0, arg1}) /]
everything else is default.
I appologize for the intrusion of this request but time is of the essence on this. I'm trying to get a JET2 project converted to Acceleo. If someone can't help me get this working then does anyone know how to get JET2 to load multiple ecore files programaticly so it can be traversed and cross-referenced?
--
-----
David Sauter