Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 440846

Summary: Live editing mode is no more working with service calls in Acceleo requests
Product: [Modeling] Acceleo Reporter: Maxime Porhel <maxime.porhel>
Component: CoreAssignee: Project Inbox <accceleo-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: florian.barbin, laurent.goubet, pierre-charles.david
Version: 3.5.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:
Attachments:
Description Flags
Sample project with java service
none
Result with Sirius 1.0.x nightly on Kepler with Acceleo 3.4 none

Description Maxime Porhel CLA 2014-07-31 04:17:57 EDT
Created attachment 245576 [details]
Sample project with java service

Steps to reproduce: 
. Unzip the attached sample project in your workspace. Do not deploy it.
. Open the aird file and its contained diagram (model folder)
. One of the container is named "invalid", the label is rendered from the service in RenderService.java -> KO
. Note that the completion proposes the service.
Comment 1 Maxime Porhel CLA 2014-07-31 04:18:51 EDT
First error: 

java.lang.ClassNotFoundException: sample.project.test.service.RenderService cannot be found by sample.project.test.service_2.0.0
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)
	at org.eclipse.acceleo.common.internal.utils.workspace.AcceleoWorkspaceUtil.internalLoadClass(AcceleoWorkspaceUtil.java:987)
	at org.eclipse.acceleo.common.internal.utils.workspace.AcceleoWorkspaceUtil.getClass(AcceleoWorkspaceUtil.java:578)
	at org.eclipse.acceleo.common.internal.utils.AcceleoServicesEclipseUtil.registerService(AcceleoServicesEclipseUtil.java:117)
	at org.eclipse.acceleo.common.internal.utils.AcceleoServicesEclipseUtil.registerService(AcceleoServicesEclipseUtil.java:198)
	at org.eclipse.acceleo.common.AcceleoServicesRegistry.addServiceClass(AcceleoServicesRegistry.java:199)
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.invoke(AcceleoLibraryOperationVisitor.java:1171)
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.callNonStandardOperation(AcceleoLibraryOperationVisitor.java:136)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1236)
	at org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:384)
	at org.eclipse.ocl.AbstractEvaluationVisitor.visitExpression(AbstractEvaluationVisitor.java:242)
	at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(EvaluationVisitorDecorator.java:150)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1910)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoQueryInvocation(AcceleoEvaluationVisitor.java:895)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1887)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
	at org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(QueryImpl.java:146)
	at org.eclipse.ocl.ecore.QueryImpl.evaluate(QueryImpl.java:56)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.doEvaluate(AcceleoEngine.java:411)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.evaluate(AcceleoEngine.java:203)
	at org.eclipse.acceleo.engine.service.AcceleoEvaluationTask.evaluateQuery(AcceleoEvaluationTask.java:122)
	at org.eclipse.acceleo.engine.service.AcceleoEvaluationTask.call(AcceleoEvaluationTask.java:291)
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.DynamicAcceleoModule.evaluate(DynamicAcceleoModule.java:536)
Comment 2 Maxime Porhel CLA 2014-07-31 04:19:57 EDT
(Note that the stack in the previous comment is a warning)

Second warning:

java.lang.ClassNotFoundException: sample.project.test.service.RenderService cannot be found by sample.project.test.service_2.0.0
	at org.eclipse.acceleo.common.internal.utils.workspace.AcceleoWorkspaceUtil.internalLoadClass(AcceleoWorkspaceUtil.java:1000)
	at org.eclipse.acceleo.common.internal.utils.workspace.AcceleoWorkspaceUtil.getClass(AcceleoWorkspaceUtil.java:578)
	at org.eclipse.acceleo.common.internal.utils.AcceleoServicesEclipseUtil.registerService(AcceleoServicesEclipseUtil.java:117)
	at org.eclipse.acceleo.common.internal.utils.AcceleoServicesEclipseUtil.registerService(AcceleoServicesEclipseUtil.java:198)
	at org.eclipse.acceleo.common.AcceleoServicesRegistry.addServiceClass(AcceleoServicesRegistry.java:199)
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.invoke(AcceleoLibraryOperationVisitor.java:1171)
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.callNonStandardOperation(AcceleoLibraryOperationVisitor.java:136)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1236)
	at org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:384)
	at org.eclipse.ocl.AbstractEvaluationVisitor.visitExpression(AbstractEvaluationVisitor.java:242)
	at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(EvaluationVisitorDecorator.java:150)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1910)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoQueryInvocation(AcceleoEvaluationVisitor.java:895)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1887)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
	at org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(Q
Comment 3 Maxime Porhel CLA 2014-07-31 04:21:39 EDT
Main error:

org.eclipse.acceleo.engine.AcceleoEvaluationException: Class sample.project.test.service.RenderService Couldn't be found in the classpath of the bundle containing module RenderService.emtl.
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.invoke(AcceleoLibraryOperationVisitor.java:1174)
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.callNonStandardOperation(AcceleoLibraryOperationVisitor.java:136)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1236)
	at org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:384)
... same stack than the other comments
Comment 4 Maxime Porhel CLA 2014-07-31 08:48:57 EDT
Detected on Win8, jdk1.6.0_45 32 bits, Luna
Comment 5 Florian Barbin CLA 2014-08-01 04:24:33 EDT
Reproduced on Debian 7.5 with jdk 1.6.0_31 as well.
Comment 6 Pierre-Charles David CLA 2014-08-05 09:26:22 EDT
We should test with combinations of Kepler/Luna and Acceleo 3.4/3.5. It might me a change/regression introduced in Acceleo 3.5 (if 3.4 works), or related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=419205 which makes parts of Acceleo (all versions) not work on Luna. The bug is marked fixed, but the fix is just a workaround to tell users not to use the mode that does not work. Basically, the "magic" that Acceleo does to dynamically load Java code from the workspace without launching a separate runtime does not work anymore with Luna. It could be the cause for the CNFE we see, as the service classes are in the workspace only.
Comment 7 Maxime Porhel CLA 2014-08-05 10:20:59 EDT
Created attachment 245728 [details]
Result with Sirius 1.0.x nightly on Kepler with Acceleo 3.4

I have just tried with 
 . eclipse-standard-kepler-SR2-Java8-win32, 
 . Sirius 1.0.x nightly 
    . http://download.eclipse.org/sirius/updates/nightly/1.0.x/kepler
    . Acceleo 3.4 is installed.

The service call from an Acceleo3 expression are wrking fine (see the attached screenshot)
Comment 8 Maxime Porhel CLA 2014-08-05 10:41:34 EDT
I have updated the environment used in the previous comment to have Kepler/Sirius 1.0.x nightly / Acceleo 3.5 

It fails to evaluate the service in live editing mode.
Comment 9 Maxime Porhel CLA 2014-08-05 10:57:44 EDT
Hi Acceleo guys, 

as said by Pierre-Charles: 
> it seems the "magic" that Acceleo does to dynamically load Java code from the 
> workspace without launching a separate runtime does not work anymore with Luna

But it does not work anymore with Accleo 3.5 on Kepler too.

Could you help us to detect what is broken ?
Comment 10 Laurent Goubet CLA 2016-04-15 04:07:14 EDT
Dynamically loading plugins from the workspace no longer works since Luna as the platform removed the (internal) APIs that allowed us to do so.