| Summary: | "Could not find Java extension class" error when disabling a Viewpoint with non-unique name | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Pierre-Charles David <pierre-charles.david> |
| Component: | Core | Assignee: | Cedric Brun <cedric.brun> |
| Status: | CLOSED FIXED | QA Contact: | Pierre-Charles David <pierre-charles.david> |
| Severity: | normal | ||
| Priority: | P3 | CC: | laurent.fasani |
| Version: | unspecified | Keywords: | triaged |
| Target Milestone: | 3.0.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/48598 https://git.eclipse.org/r/48599 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a9a8b6e508436998209dd5f21f6b6b683041c3a3 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a7a3d50497c2224e94b58d6bdd0c4a39e785b3ee |
||
| Whiteboard: | |||
|
Description
Pierre-Charles David
The following patch *seems* to fix the issue, but I'm not familiar enough with that part of the code to be sure if it's a good idead or not:
diff --git src/org/eclipse/sirius/common/tools/api/interpreter/JavaExtensionsManager.java src/org/eclipse/sirius/common/tools/api/interpreter/JavaExtensionsManager.java
index 5dfdc0c..5ae5a95 100644
--- src/org/eclipse/sirius/common/tools/api/interpreter/JavaExtensionsManager.java
+++ src/org/eclipse/sirius/common/tools/api/interpreter/JavaExtensionsManager.java
@@ -588,6 +589,8 @@
plugins.add(pluginCandidate.segment(1));
}
}
+ } else {
+ clearImports();
}
updateScope(plugins, prjs);
}
I've pushed a draft with the previous patch as https://git.eclipse.org/r/48461 to see what Gerrit says. (In reply to Pierre-Charles David from comment #0) The scenario in comment #0 don't lead to the issue Below is the modified scenario (modified step : 3-4-6) Steps to reproduce, on Sirius master (~3.0.0rc1a): 1. Launch a runtime where both Ecore Tools (Mars version) and org.eclipse.sirius.sample.ecore.design are installed. They both define a viewpoint named "Design" and the issue seems related to this. 2. Create a basic Modeling project and an empty Ecore file inside. 3. Open the "Viewpoint Selection" dialog on the project, and enable both available "Design" viewpoints. 4. Expand the Ecore semantic model and right-click on the root package, and dismiss the menu. This step seems required to ensure all the plugins/classes related to the issue are loaded. 5. Make sure the Error log view is open and clear it if needed. 6. Re-open the "Viewpoint Selection" dialog, deselect one of the selected "Design" viewpoint => one or more messages appear in the error log of the form ""Could not find Java extension class XXX". This is actually not linked to the fact that Viewpoints have the same names, but is a linked to a lack in the protocol/API for interpreters : one can't tell an IInterpreter : here are your qualified class names to imports AND the classpath scope in a single call. When the JavaExtensionManager is called with an "updateScope" and already have registered qualified class names, it will try to reload those classes eagerly (this is done in org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.configureInterpreter()) through
this.interpreter.setProperty(IInterpreter.FILES, null);
this.interpreter.setProperty(IInterpreter.FILES, filePaths);
=> services can't be loaded, an error is logged
And the very next method call:
InterpreterRegistry.prepareImportsFromSession(this.interpreter, this);
will end up clearing the imports and then setting the new imports
=> the services are loaded correctly
Indeed the patchset at https://git.eclipse.org/r/48461 makes the error disappear as it's clearing the import while updating the scope but it will only work if the client code *re-add the imports* after such call (and I suspect it is the case through the Sirius code)
This problem appeared with the introduction of JavaExtensionManager as this class is not "lazy" and will try to load as-soon as the configuration (scope or imports) changed while other implementations are just "keeping this data around" and will initialize/load the classes during request evaluation.
New Gerrit change created: https://git.eclipse.org/r/48598 New Gerrit change created: https://git.eclipse.org/r/48599 Gerrit change https://git.eclipse.org/r/48598 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a9a8b6e508436998209dd5f21f6b6b683041c3a3 Gerrit change https://git.eclipse.org/r/48599 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a7a3d50497c2224e94b58d6bdd0c4a39e785b3ee Fixed. Verified on Sirius 3.0.0rc2. Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0. |