Repository navigation
Replies: 7 comments
|
For loading Java service classes Acceleo only use Java classes from the metamodel so it should not be the source of this error message. Do you have this error on a specific call in your module ? It looks like a runtime error, do you have the error stack ? |
|
Hello, Only my metamodel B references metamodel A. After further investigation, I discovered that I’m calling a method from a Java class (in my mtl) that imports metamodel B, even though I’m not using that specific method that use metamodel B in my template. It seems that Acceleo performs validation/checks for all imports of that Java service, not only the ones I reference in my .mtl. Do I need to split that Java service into two classes: one containing the method(s) that don’t rely on metamodel B, and another containing the method(s) that do use metamodel B? |
|
This error most likely happens when Acceleo tries to load Helpers service class and can't find the Which version of Acceleo are you using ? |
|
I’m using Acceleo 4.1. I chose to separate my service classes because I don’t want my plugin to depend on a model that I’m not using. |
|
No, Acceleo should be able to load the class (from what I understood). I think it's related to a bug that has been fixed where classes from transitive dependencies couldn't be loaded. |
|
It seems that zipped update site are unavailable : https://www.eclipse.org/downloads/download.php?file=/acceleo/downloads/drops/4.2/R202603201315/acceleo-update-4.2.2.zip&protocol=https I can't install by update site on this computer. Do you know where i can found zipped update site of the latest version ? |
|
With the PHP CVE download.eclipse.org is down... You will have to retry later. Also note there is a version 4.2.3. |
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone, I have an issue with Acceleo and I’d like to ask whether this behavior is expected.
Context
I’m using an Acceleo plugin (Eclipse/OSGi) that contains
.mtlfiles which reference metamodel A.So, in my plugin, I declare a dependency on metamodel A so it can be found at runtime.
I also have a second plugin (let’s call it Helpers) that contains some Java services.
The Helpers plugin itself has a dependency on metamodel B (because some of its Java services rely on metamodel B).
What I’m seeing
When I open my Eclipse workspace, Acceleo throws an error saying it can’t resolve a class that belongs to metamodel B.
The important point is: in my Acceleo
.mtlfiles, I never reference anything from metamodel B. The only mention of metamodel B is indirectly via the dependency chain (through the Helpers plugin). Also, I don’t use the specific services that rely on metamodel B.When I generate the Java code from my
.mtlfiles using the Acceleo “Generate Java” menu, I can see that in the generated code, in the methodstandalone.Initialization, it is possible to resolve metamodel A, for example:Workaround
To make the error go away, I added this line in
standalone.Initialization:After that, the error disappears.
Question
Is it a known/expected Acceleo behavior that metamodel B must be referenced explicitly in the generated initialization code, even if my
.mtltemplates don’t use metamodel B directly (and only a dependency plugin uses it)? Or am I missing something in the plugin dependency configuration / classpath setup?Thanks in advance!
All reactions