Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » IllegalStateException when editing Complete OCL file(OCL causes a lot of problems, including spurious error dialogs and errors on editing file, usually with a message like "Cannot modify resource without a transaction")
IllegalStateException when editing Complete OCL file [message #1863697] Wed, 21 February 2024 17:53 Go to next message
Guillaume Dupont is currently offline Guillaume DupontFriend
Messages: 21
Registered: April 2017
Junior Member
Hello,

I am encountering major issues with Complete OCL, I really do not know what to do. I guess I must be doing something wrong?

I have a fresh installation of Eclipse Modeling 2023-12 (from Oomph) on Java 17, on which I installed OCL 6.19 "All-in-one SDK" from the update site (https://download.eclipse.org/modeling/mdt/ocl/updates/releases/6.19.0). I am on a new empty workspace (no .metadata, no nothing, everything is fresh).

I create a project, I create a .ecore meta-model, so far so good. Then I try to create a Complete OCL document. I get an error dialog about "Cannot modify resource without a transaction". When I close the OCL and I open it again, I get an error view instead of the editor, with the following error and stack trace:
java.lang.IllegalStateException: Cannot modify resource set without a write transaction
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:344)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:298)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:280)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:236)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.ocl.pivot.internal.TypedElementImpl.setType(TypedElementImpl.java:184)
	at org.eclipse.ocl.pivot.internal.PropertyImpl.unloaded(PropertyImpl.java:1782)
	at org.eclipse.ocl.pivot.internal.resource.ASResourceImpl.unloaded(ASResourceImpl.java:568)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doUnload(ResourceImpl.java:1706)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doUnload(XMLResourceImpl.java:720)
	at org.eclipse.ocl.pivot.internal.resource.ASResourceImpl.doUnload(ASResourceImpl.java:332)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.unload(ResourceImpl.java:1721)
	at org.eclipse.ocl.pivot.internal.ecore.es2as.AbstractExternal2AS.dispose(AbstractExternal2AS.java:77)
	at org.eclipse.ocl.pivot.internal.manager.PivotMetamodelManager.dispose(PivotMetamodelManager.java:697)
	at org.eclipse.ocl.pivot.utilities.AbstractEnvironmentFactory.disposeInternal(AbstractEnvironmentFactory.java:677)
	at org.eclipse.ocl.pivot.utilities.AbstractEnvironmentFactory.dispose(AbstractEnvironmentFactory.java:669)
	at org.eclipse.ocl.pivot.utilities.AbstractEnvironmentFactory.detach(AbstractEnvironmentFactory.java:649)
	at org.eclipse.ocl.pivot.utilities.ThreadLocalExecutor.setEnvironmentFactory(ThreadLocalExecutor.java:414)
	at org.eclipse.ocl.xtext.base.ui.utilities.ThreadLocalExecutorUI.localInitPart(ThreadLocalExecutorUI.java:109)
	at org.eclipse.ocl.xtext.base.ui.utilities.ThreadLocalExecutorUI.initPart(ThreadLocalExecutorUI.java:53)
	at org.eclipse.ocl.xtext.base.ui.model.BaseDocumentProvider.initOCL(BaseDocumentProvider.java:75)
	at org.eclipse.ocl.xtext.base.ui.BaseEditor.setDocumentProvider(BaseEditor.java:61)
	at org.eclipse.xtext.ui.editor.XtextEditor.init(XtextEditor.java:289)
	at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:976)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:938)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:138)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:385)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:311)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:203)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:995)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:659)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:763)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:728)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:712)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.lambda$0(PartServiceImpl.java:105)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:183)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5959)
	at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:208)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:206)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:170)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:188)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:661)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:625)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:796)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:401)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1270)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3233)
	at org.eclipse.ui.internal.WorkbenchPage.lambda$11(WorkbenchPage.java:3123)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3121)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3091)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3082)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:548)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:508)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:367)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:172)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:288)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:254)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:252)
	at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:53)
	at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:215)
	at org.eclipse.ui.navigator.CommonNavigatorManager$1.open(CommonNavigatorManager.java:184)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:800)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:797)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1115)
	at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:452)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:296)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:331)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5854)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1529)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5064)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4516)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:648)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:342)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:555)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1432)


Of course, loading an OCL file on an .xmi model created with "Create Dynamic Instance" is out of the question (it crashes the editor with a similar stack trace).

Am I doing something particularly wrong? Is my configuration not good in any way? Is this maybe a bug with Complete OCL? I have ran out of options to be honest...


Regards,
G. D.
Re: IllegalStateException when editing Complete OCL file [message #1863698 is a reply to message #1863697] Wed, 21 February 2024 18:09 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7663
Registered: July 2009
Senior Member
Hm. This is impossible. Eclipse OCL does not use org.eclipse.emf.transaction.

Are you sure that you are not using Papyrus or Sirius?

Please raise a Bugzilla with clear repro instructiions and a copy of Help->About Eclipse->Installation Details->Configuration

Maybe 6.18 might be better.

Re: IllegalStateException when editing Complete OCL file [message #1863703 is a reply to message #1863698] Wed, 21 February 2024 22:49 Go to previous messageGo to next message
Guillaume Dupont is currently offline Guillaume DupontFriend
Messages: 21
Registered: April 2017
Junior Member
Yes I am quite sure this is Eclipse Modeling 2023-12...

I submitted a bug report as you suggested (https://bugs.eclipse.org/bugs/show_bug.cgi?id=582958).

I tried installing OCL 6.18 but it seems Eclipse cannot perform the installation because of missing dependencies. For the record:
Cannot complete the install because one or more required items could not be found.
  Software being installed: OCL All-In-One SDK 6.18.0.v20221201-0557 (org.eclipse.ocl.master.feature.group 6.18.0.v20221201-0557)
  Missing requirement: OCL build support for the Xtext Declarative Serializer 1.18.0.v20221201-0557 (org.eclipse.ocl.examples.xtext.build 1.18.0.v20221201-0557) requires 'osgi.bundle; org.eclipse.xtext.generator [2.9.0,3.0.0)' but it could not be found
  Cannot satisfy dependency:
    From: OCL Build Support 6.18.0.v20221201-0557 (org.eclipse.ocl.build.feature.group 6.18.0.v20221201-0557)
    To: org.eclipse.equinox.p2.iu; org.eclipse.ocl.examples.xtext.build [1.18.0.v20221201-0557,1.18.0.v20221201-0557]
  Cannot satisfy dependency:
    From: OCL All-In-One SDK 6.18.0.v20221201-0557 (org.eclipse.ocl.master.feature.group 6.18.0.v20221201-0557)
    To: org.eclipse.equinox.p2.iu; org.eclipse.ocl.build.feature.group [6.18.0.v20221201-0557,6.18.0.v20221201-0557]


I will look into it but this means I may have to use an older version of Eclipse...
Re: IllegalStateException when editing Complete OCL file [message #1863710 is a reply to message #1863703] Thu, 22 February 2024 08:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7663
Registered: July 2009
Senior Member
Thanks for raising https://bugs.eclipse.org/bugs/show_bug.cgi?id=582958 which it appears you are not getting emails from. Please read my comments / requests there.

(Going back to 6.18 may indeed be difficult since Xtext retracted longstanding functionality in 2023-12. You need the previous Xtext too.)

Fixing this issue joins Bug 582722 as my top priority for 6.20.0RC1 this week. If you can wait, struggling with old versions may be a bit pointless.

A better workaround may be to ensure that you use the Java / Plugin rather than Modeling / Sirius perspective when using an OCL editor.

[Updated on: Thu, 22 February 2024 08:37]

Report message to a moderator

Re: IllegalStateException when editing Complete OCL file [message #1863783 is a reply to message #1863710] Mon, 26 February 2024 19:05 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7663
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=582958 fixed for 2024-03RC1.

Problem probably caused by use of OCL->Save Abstract Syntax persisting a *.oclas file that confuses the Modeling Perspective *.aird update.

Workaround of using Java/Plugin perpective should work.

Repair is to manually edit the *.aird to remove *.oclas semanticResources.

Previous Topic:Generating OCLinEcore Code
Next Topic:Drops and Updates are now Builds
Goto Forum:
  


Current Time: Sun Jul 14 05:56:53 GMT 2024

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

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

Back to the top