ChangeRecorder cannot be found by org.eclipse.emf.edit [message #1841102] |
Mon, 03 May 2021 21:46 |
Jean-Baptiste Meyer Messages: 16 Registered: February 2021 |
Junior Member |
|
|
Hello Lorenzo,
Hello Vincenzo,
Hello Parsley team,
Hello users,
I already posted this issue in the EMF forum without any responses
I'm completely stuck since several days with an OSGI NoClassDefFoundError exception
I have RAP application using Parsley deployed with equinox.
I'm doing a custom contextual menu with emfMenus exactly like described in the documentation.
Here is my code for the GuiceModule
module com.merckgroup.bio4c.deviceshape.editor.signal extends ViewEmfParsleyGuiceModule {
parts {
viewpart com.merckgroup.bio4c.deviceshape.editor.view.signal{
viewname "Signal Editor"
viewclass SignalSaveableTreeFormView
}
}
/*
FIRST TEST WITH SAME ISSUE
menuBuilder{
emfMenus{
Signal s -> #[
actionChange("Add a reference", s,
[
signal |
val ref = ReferencesFactory.eINSTANCE.createSignalReference
ref.^label = "REF:"+s.name
])
]
}
}*/
bindings{
type ViewerContentProvider -> SignalContentProvider
type EditingMenuBuilder -> SignalMenuBuilder
}
}
Here is my EditingMenuBuilder
public class SignalMenuBuilder extends EditingMenuBuilder {
public List<IMenuContributionSpecification> emfMenuContributions(final Signal s) {
DeviceShape deviceShapeLoaded = (DeviceShape) RWT.getUISession()
.getAttribute(DeviceShapeConfigurations.DEVICE_SHAPE_LOADED);
//HERE I do not have the issue the ChangeRecorder is found by the class loader
ChangeRecorder changeRecorder = new ChangeRecorder();
final IAcceptor<Signal> _function = (Signal signal) -> {
var ref = ReferencesFactory.eINSTANCE.createSignalReference
ref.setLabel("New Ref");
signal.getReference().add(ref);
}
};
IMenuContributionSpecification _actionChange = this.<Signal>actionChange("Add a new reference", s, _function);
return Collections.<IMenuContributionSpecification>unmodifiableList(
CollectionLiterals.<IMenuContributionSpecification>newArrayList(_actionChange));
}
When I'm right clicking on my tree and clicking on the action I do have the following stack trace :
!ENTRY org.eclipse.rap.ui 4 0 2021-05-03 22:56:42.852
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/change/util/ChangeRecorder
at org.eclipse.emf.edit.command.ChangeCommand.createChangeRecorder(ChangeCommand.java:95)
at org.eclipse.emf.edit.command.ChangeCommand.execute(ChangeCommand.java:123)
at org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
at org.eclipse.emf.parsley.edit.action.EmfCommandAction.run(EmfCommandAction.java:60)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:493)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:575)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:492)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:403)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:109)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:687)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:594)
at org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1217)
at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1198)
at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1181)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1173)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:701)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:684)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
at com.merckgroup.bio4c.deviceshape.editor.signal.SignalEntryPoint.createUI(SignalEntryPoint.java:17)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:177)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:290)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:107)
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.change.util.ChangeRecorder cannot be found by org.eclipse.emf.edit_2.16.0.v20190920-0401
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 27 more
Stack trace line 95 in ChangeCommand is pointing to
package org.eclipse.emf.edit.command;
import java.util.Collection;
import java.util.Collections;
import org.eclipse.emf.common.command.AbstractCommand;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.ecore.change.ChangeDescription;
import org.eclipse.emf.ecore.change.util.ChangeRecorder;
/**
* <p>This command uses the Change Model facilities to enable a group of modifications
* to be executed as one single command. The undo operation reverts all the
* modifications made when the command was executed</p>
* <p>In order to use this class, the <tt>org.eclipse.emf.ecore.change</tt> plugin has to
* be available in your Eclipse configuration.</p>
*
* @since 2.2.0
*/
abstract public class ChangeCommand extends AbstractCommand
{
.....
......
protected ChangeRecorder createChangeRecorder()
{
-----> line: 95 return new ChangeRecorder();
}
My bundles are well loaded in Equinox
osgi> ss
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.16.200.v20210226-1447
1 ACTIVE unknown_0.0.0 [1]
3 ACTIVE org.eclipse.equinox.http.registry_1.2.0.v20200614-1851
4 ACTIVE org.eclipse.jetty.server_9.4.37.v20210219
5 ACTIVE org.eclipse.jetty.util.ajax_9.4.37.v20210219
6 ACTIVE org.eclipse.osgi.services_3.10.0.v20210212-1137
7 ACTIVE org.eclipse.equinox.registry_3.10.100.v20210212-1143
8 ACTIVE org.apache.commons.lang3_3.10.0
9 ACTIVE com.google.guava_30.1.0.v20210127-2300
10 ACTIVE org.eclipse.core.commands_3.9.800.v20201021-1339
11 ACTIVE org.eclipse.rap.ui.forms_3.16.0.20210107-1310
12 ACTIVE org.eclipse.equinox.preferences_3.8.200.v20210212-1143
13 ACTIVE org.apache.commons.fileupload_1.3.2.v20170320-2229
14 ACTIVE org.eclipse.rap.jface.databinding_3.16.0.20210107-1310
15 ACTIVE org.apache.felix.gogo.shell_1.1.4.v20210111-1007
16 ACTIVE org.eclipse.equinox.http.servlet_1.7.0.v20210202-1229
17 ACTIVE org.apache.xmlbeans.xmlbeans_3.1.0
18 ACTIVE org.apache.poi.poi-ooxml_4.1.2
19 ACTIVE org.apache.felix.gogo.runtime_1.1.4.v20210111-1007
20 ACTIVE org.eclipse.equinox.console_1.4.300.v20210211-2058
21 ACTIVE org.eclipse.emf.parsley.rap_1.10.0.v20200415-1512
22 ACTIVE com.fasterxml.jackson.core.jackson-core_2.10.3
23 ACTIVE org.eclipse.emf.rap.common.ui_2.11.0.v20201230-0839
24 ACTIVE org.emfjson.jackson_1.3.0
25 ACTIVE javax.servlet_3.1.0.v201410161800
26 ACTIVE org.eclipse.rap.ui.workbench_3.16.0.20210107-1310
27 ACTIVE org.apache.commons.commons-collections4_4.4.0
----->28 ACTIVE org.eclipse.emf.edit_2.16.0.v20190920-0401<------
29 ACTIVE org.eclipse.emf.rap.edit.ui_2.11.0.v20180706-1146
30 ACTIVE org.eclipse.emf.ecore.edit_2.13.0.v20190822-1451
31 ACTIVE org.eclipse.rap.rwt.osgi_3.16.0.20210107-1310
32 ACTIVE org.eclipse.osgi.util_3.6.0.v20210212-1137
33 ACTIVE org.apache.poi.poi_4.1.2
34 ACTIVE org.eclipse.emf.databinding_1.5.0.v20180706-1146
35 ACTIVE org.apache.poi.poi-ooxml-schemas_4.1.2
36 ACTIVE org.eclipse.core.contenttype_3.7.900.v20210111-0918
37 ACTIVE org.eclipse.emf.parsley.common_1.10.0.v20200415-1512
38 ACTIVE org.eclipse.jetty.io_9.4.37.v20210219
39 ACTIVE org.eclipse.core.databinding.observable_1.10.0.v20200730-0848
40 ACTIVE org.eclipse.xtext.xbase.lib_2.25.0.v20210301-0821
41 ACTIVE org.eclipse.equinox.app_1.5.100.v20210212-1143
42 ACTIVE org.eclipse.core.runtime_3.20.100.v20210111-0815
43 ACTIVE com.fasterxml.jackson.core.jackson-annotations_2.10.3
44 ACTIVE org.eclipse.emf.parsley.rap.runtime_1.10.0.v20200415-1512
45 ACTIVE org.eclipse.emf.common_2.22.0.v20210114-1734
46 ACTIVE org.eclipse.core.jobs_3.10.1100.v20210111-0815
47 ACTIVE org.eclipse.equinox.common_3.14.100.v20210212-1143
48 ACTIVE org.eclipse.help_3.8.800.v20200525-0755
49 ACTIVE org.eclipse.core.expressions_3.7.100.v20210203-1000
50 ACTIVE org.eclipse.rap.fileupload_3.16.0.20210107-1425
51 ACTIVE com.ibm.icu_67.1.0.v20200706-1749
52 ACTIVE org.eclipse.emf.ecore_2.23.0.v20200630-0516
53 ACTIVE com.fasterxml.jackson.core.jackson-databind_2.10.3
54 ACTIVE org.eclipse.emf.parsley.rap.views_1.10.0.v20200415-1512
56 ACTIVE org.eclipse.equinox.http.jetty_3.7.600.v20210224-2143
57 ACTIVE org.apache.log4j_1.2.15.v201012070815
58 ACTIVE org.eclipse.jetty.util_9.4.37.v20210219
59 ACTIVE com.google.inject_3.0.0.v201605172100
60 ACTIVE org.eclipse.core.databinding.property_1.8.100.v20200619-0651
61 ACTIVE org.eclipse.core.databinding_1.10.100.v20200926-1123
62 ACTIVE org.eclipse.rap.filedialog_3.16.0.20210107-1310
63 ACTIVE javax.inject_1.0.0.v20091030
64 ACTIVE org.eclipse.rap.rwt_3.16.0.20210304-1215
65 ACTIVE org.eclipse.rap.ui.views_3.16.0.20210107-1310
66 ACTIVE org.eclipse.emf.ecore.xmi_2.16.0.v20190528-0725
67 ACTIVE org.eclipse.emf.parsley.views.common_1.10.0.v20200415-1512
68 ACTIVE org.eclipse.emf.parsley.runtime.common_1.10.0.v20200415-1512
69 ACTIVE javax.xml_1.3.4.v201005080400
70 ACTIVE org.eclipse.jetty.continuation_9.4.37.v20210219
71 ACTIVE org.apache.commons.commons-compress_1.19.0
72 ACTIVE org.eclipse.rap.jface_3.16.0.20210107-1310
73 ACTIVE org.eclipse.jetty.servlet_9.4.37.v20210219
74 ACTIVE org.eclipse.rap.ui_3.16.0.20210107-1310
75 ACTIVE org.apache.commons.io_2.6.0.v20190123-2029
76 ACTIVE org.eclipse.jetty.http_9.4.37.v20210219
77 ACTIVE org.eclipse.jetty.security_9.4.37.v20210219
78 ACTIVE org.apache.logging.log4j_2.8.2.v20200818-1118
79 ACTIVE org.eclipse.emf.databinding.edit_1.7.0.v20210113-0340
----->80 ACTIVE org.eclipse.emf.ecore.change_2.14.0.v20190528-0725<-------
82 ACTIVE com.merckgroup.bio4c.deviceshape.generic-editor_1.0.0.qualifier
86 ACTIVE com.merckgroup.bio4c.deviceshape.device-shape-lib-all_1.0.0.SNAPSHOT
osgi>
org.eclipse.emf.edit is requiring org.eclipse.emf.ecore.change which is provided
osgi> headers 28
Bundle headers:
Automatic-Module-Name = org.eclipse.emf.edit
Build-Jdk-Spec = 11
Bundle-ActivationPolicy = lazy
Bundle-Activator = org.eclipse.emf.edit.EMFEditPlugin$Implementation$Activator
Bundle-ClassPath = .
Bundle-Localization = plugin
Bundle-ManifestVersion = 2
Bundle-Name = EMF Edit
Bundle-RequiredExecutionEnvironment = J2SE-1.5
Bundle-SymbolicName = org.eclipse.emf.edit; singleton:=true
Bundle-Vendor = Eclipse Modeling Project
Bundle-Version = 2.16.0.v20190920-0401
Created-By = Maven Archiver 3.5.0
Eclipse-LazyStart = true
Eclipse-SourceReferences = scm:git:https://git.eclipse.org/r/p/emf/org.eclipse.emf.git;path="plugins/org.eclipse.emf.edit";commitId=5a81b9548a1e4696fe41374d532fdd2b2e7f87fa
Export-Package = org.eclipse.emf.edit,org.eclipse.emf.edit.command,org.eclipse.emf.edit.domain,org.eclipse.emf.edit.provider,org.eclipse.emf.edit.provider.resource,org.eclipse.emf.edit.tree,org.eclipse.emf.edit.tree.impl,org.eclipse.emf.edit.tree.provider,org.eclipse.emf.edit.tree.util
Import-Package = org.osgi.framework;version="[1.5.0,2.0.0)"
Manifest-Version = 1.0
Require-Bundle = org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)";resolution:=optional;x-installation:=greedy,org.eclipse.emf.common;bundle-version="[2.17.0,3.0.0)";visibility:=reexport,org.eclipse.emf.ecore;bundle-version="[2.20.0,3.0.0)";visibility:=reexport,org.eclipse.emf.ecore.change;bundle-version="[2.14.0,3.0.0)";resolution:=optional;visibility:=reexport;x-installation:=greedy
Has someone get an idea when I'm facing this issue ? Is this a problem with the packaging of org.eclipse.emf.edit or something like that ?
Did someone already faced this issue or can someone can guide me ?
Is there in the example project an example for menuBuilder to try if I have the same issue ?
Thanks a lot,
JB
[Updated on: Tue, 04 May 2021 06:14] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04357 seconds