Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] pb with java services(error when i want to call java services)
[Acceleo] pb with java services [message #1754102] Tue, 14 February 2017 14:33 Go to next message
Julien Pourille is currently offline Julien PourilleFriend
Messages: 8
Registered: February 2017
Junior Member
Hy everybody,

I have a big problem and nobody that I know could resolve it.

I juste want to create a Java services class which is called by Acceleo template.

[comment encoding = UTF-8 /]
[module javaservices('')/]

[query public getDescription(aFunction: Function) : String
	= invoke('', 'getDescription(java.lang.String)', Sequence{})

import stanHelp.Function;

public class JavaServices {
	public String getDescription(String aFunctionId) {
		return "Description of : " + aFunctionId;


[comment encoding = UTF-8 /]
[module generate('')]

[import org::eclipse::acceleo::module::sample::services::javaservices /]

[template public generateElement(aMainContainer : MainContainer)]
[comment @main/]

[let aFunction : Function = aMainContainer.functions->first()]
	[file ('test.html', false, 'UTF-8')]


When I execute this code, i have the following warning :

Invalid result for expression self.invoke('', 'getDescription(stanHelp.Function)', Sequence {arg0}) at line 4 in Module javaservices for query getDescription(Function). Last recorded value of self was org.eclipse.emf.ecore.impl.DynamicEObjectImpl@3cd517a7 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@7bb6c78c (name: MainContainer) (instanceClassName: null) (abstract: false, interface: false)). Problem found while generating the file '/home/ssp/T0164153/workspace_acceleo/org.eclipse.acceleo.module.sample/generatedHtml/test.html'.

And the following error :

One of the parameters' class couldn't be loaded for method getDescription(stanHelp.Function) of class

Can anyone help me to solve this strange problem?

Re: [Acceleo] pb with java services [message #1754348 is a reply to message #1754102] Thu, 16 February 2017 15:40 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7635
Registered: July 2009
Senior Member

Since nobody else is helping, I can give a half reply.

IIRC Acceleo's invoke is very helpful, but requires at least a couple of duplicate declarations to be consistent. Otherwise bang. Again IIRC I raised a Bugzilla to provide a wizard/validation/diagnosis of the nightmare.

I suggest you practice on an invoke that works and then change one thing at a time, on each duplicate, till you get to where you want to.


Ed Willink
Previous Topic:Incremental for loop
Next Topic:[Acceleo] How to avoid generating lines with only whitespace
Goto Forum:

Current Time: Thu Nov 30 18:01:31 GMT 2023

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

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

Back to the top