Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » InterruptedException in EMF Transaction layer
InterruptedException in EMF Transaction layer [message #429855] Tue, 05 May 2009 10:05 Go to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi all,

While working on a diagram editor based on GMF I ran into a weird
exception (stack trace below).
Does anyone knows why it was thrown and what it means? Any ideas are
appreciated.
Thanks in advance.

Cheers,
Alex

java.lang.InterruptedException: Attempted to beginRule:
org.eclipse.emf.transaction.util.Lock$AcquireRule@2db02db, does not match
outer scope rule:
org.eclipse.emf.transaction.util.Lock$AcquireRule@1a0f1a0f
at org.eclipse.emf.transaction.util.Lock.uiSafeAcquire(Lock.jav a:475)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.acquire(TransactionalEditingDomainImpl.java:541)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.activate(TransactionalEditingDomainImpl.java:469)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLTransact ionalEditingDomain.activate(MSLTransactionalEditingDomain.ja va:220)
at
org.eclipse.emf.transaction.impl.TransactionImpl.start(Trans actionImpl.java:184)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLTransact ionalEditingDomain.startTransaction(MSLTransactionalEditingD omain.java:197)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLTransact ionalEditingDomain.runExclusive(MSLTransactionalEditingDomai n.java:332)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLEditingD omain.runExclusive(MSLEditingDomain.java:2656)
at
org.eclipse.gmf.runtime.diagram.ui.internal.actions.Property ChangeAction.getPropertyValue(PropertyChangeAction.java:154)
at
org.eclipse.gmf.runtime.diagram.ui.internal.actions.Property ChangeAction.getOperationSetPropertyValue(PropertyChangeActi on.java:138)
at
org.eclipse.gmf.runtime.diagram.ui.actions.CheckedPropertyAc tion.calculateChecked(CheckedPropertyAction.java:74)
at
org.eclipse.gmf.runtime.diagram.ui.actions.CheckedPropertyAc tion.refresh(CheckedPropertyAction.java:65)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandl er$2.partActivated(AbstractActionHandler.java:158)
at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerL ist.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at
org.eclipse.ui.internal.PartListenerList.fireEvent(PartListe nerList.java:57)
at
org.eclipse.ui.internal.PartListenerList.firePartActivated(P artListenerList.java:70)
at
org.eclipse.ui.internal.PartService.firePartActivated(PartSe rvice.java:186)
at org.eclipse.ui.internal.PartService.setActivePart(PartServic e.java:305)
at
org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePart Changed(WorkbenchPagePartList.java:56)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java :126)
at
org.eclipse.ui.internal.WorkbenchPage.setActivePart(Workbenc hPage.java:3491)
at
org.eclipse.ui.internal.WorkbenchPage.requestActivation(Work benchPage.java:3034)
at org.eclipse.ui.internal.PartPane.requestActivation(PartPane. java:272)
at org.eclipse.ui.internal.EditorPane.requestActivation(EditorP ane.java:98)
at org.eclipse.ui.internal.PartPane.handleEvent(PartPane.java:2 36)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:13 53)
at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java: 2443)
at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2266)
at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:441 4)
at org.eclipse.swt.widgets.Canvas.WM_SETFOCUS(Canvas.java:443)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3855 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528 )
at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method)
at org.eclipse.swt.widgets.Control.forceFocus(Control.java:974)
at org.eclipse.swt.widgets.Control.setSavedFocus(Control.java:3 080)
at org.eclipse.swt.widgets.Decorations.restoreFocus(Decorations .java:808)
at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations. java:1617)
at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2013)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3784 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.j ava:1576)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1937)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528 )
at org.eclipse.swt.internal.win32.OS.DestroyWindow(Native Method)
at org.eclipse.swt.widgets.Control.destroyWidget(Control.java:6 63)
at org.eclipse.swt.widgets.Shell.destroyWidget(Shell.java:657)
at org.eclipse.swt.widgets.Widget.release(Widget.java:814)
at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java :446)
at org.eclipse.swt.widgets.Shell.dispose(Shell.java:674)
at org.eclipse.jface.window.Window.close(Window.java:335)
at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:979)
at
org.eclipse.ui.internal.progress.BlockedJobsDialog.close(Blo ckedJobsDialog.java:443)
at
org.eclipse.ui.internal.progress.BlockedJobsDialog.close(Blo ckedJobsDialog.java:431)
at
org.eclipse.ui.internal.progress.BlockedJobsDialog.clear(Blo ckedJobsDialog.java:245)
at
org.eclipse.ui.internal.dialogs.WorkbenchDialogBlockedHandle r.clearBlocked(WorkbenchDialogBlockedHandler.java:48)
at
org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.cle arBlocked(EventLoopProgressMonitor.java:73)
at
org.eclipse.core.internal.jobs.JobManager.reportUnblocked(Jo bManager.java:916)
at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJo bs.java:100)
at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManag er.java:230)
at org.eclipse.emf.transaction.util.Lock.uiSafeAcquire(Lock.jav a:404)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.acquire(TransactionalEditingDomainImpl.java:541)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.activate(TransactionalEditingDomainImpl.java:469)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLTransact ionalEditingDomain.activate(MSLTransactionalEditingDomain.ja va:220)
at
org.eclipse.emf.transaction.impl.TransactionImpl.start(Trans actionImpl.java:184)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLTransact ionalEditingDomain.startTransaction(MSLTransactionalEditingD omain.java:197)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLTransact ionalEditingDomain.runExclusive(MSLTransactionalEditingDomai n.java:332)
at
org.eclipse.gmf.runtime.emf.core.internal.domain.MSLEditingD omain.runExclusive(MSLEditingDomain.java:2656)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(GraphicalEditPart.java:461)
at
org.eclipse.gmf.runtime.diagram.ui.internal.actions.CustomCo ntributionItem.getCommand(CustomContributionItem.java:134)
at
org.eclipse.gmf.runtime.diagram.ui.internal.actions.CustomCo ntributionItem.getCommand(CustomContributionItem.java:120)
at
org.eclipse.gmf.runtime.diagram.ui.internal.actions.CustomCo ntributionItem.calculateEnabled(CustomContributionItem.java: 85)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractContributio nItem.refresh(AbstractContributionItem.java:429)
at
org.eclipse.gmf.runtime.diagram.ui.internal.actions.CustomCo ntributionItem.refresh(CustomContributionItem.java:81)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractContributio nItem.update(AbstractContributionItem.java:416)
at
org.eclipse.gmf.runtime.common.ui.action.AbstractContributio nItem$3.run(AbstractContributionItem.java:659)
at
org.eclipse.ui.internal.UILockListener.doPendingWork(UILockL istener.java:155)
at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer. java:158)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3425)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 00)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:59)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:39)
at java.lang.reflect.Method.invoke(Method.java:612)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Re: InterruptedException in EMF Transaction layer [message #429862 is a reply to message #429855] Tue, 05 May 2009 15:29 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

--=-nPk27t+3mJqL0mGeR6A4
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Alex,

I can explain what happened, but not what to do about it.


1. The UI thread attempted to start a transaction, and in so doing
block on a Lock::AcquireRule waiting for a job to get the
transaction lock on its behalf.
2. This wasn't immediately available, so the Blocked UI Jobs dialog
was shown to alert the user that there is some hold-up.
3. Once the lock became available, the UI thread was granted the
Lock::AcquireRule that it was waiting for and the dialog was
taken down.
4. The disappearance of the model dialog re-activated the workbench
window, which in turn re-activated some part in that window.
5. This part, on activation, attempts to start another transaction
on the UI thread. However, a transaction is already in
progress, so the second attempt to start is aborted by an
InterruptException.

I think this is quite what you would want to happen: the original
transaction is protected against corruption by the re-entrant attempt to
start another. It is unfortunate that a part activation listener is
trying to start a transaction, but it should be aware that it is running
on the UI thread and that it is therefore subject to interruption, from
which it must recover somehow. There's just no way around that.

HTH,

Christian


On Tue, 2009-05-05 at 10:05 +0000, Alex Boyko wrote:

> Hi all,
>
> While working on a diagram editor based on GMF I ran into a weird
> exception (stack trace below).
> Does anyone knows why it was thrown and what it means? Any ideas are
> appreciated.
> Thanks in advance.
>
> Cheers,
> Alex
>
> java.lang.InterruptedException: Attempted to beginRule:
> org.eclipse.emf.transaction.util.Lock$AcquireRule@2db02db, does not match
> outer scope rule:
> org.eclipse.emf.transaction.util.Lock$AcquireRule@1a0f1a0f
> at org.eclipse.emf.transaction.util.Lock.uiSafeAcquire(Lock.jav a:475)


-----8<-----


--=-nPk27t+3mJqL0mGeR6A4
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Alex,<BR>
<BR>
I can explain what happened, but not what to do about it.<BR>
<BR>
<OL TYPE=1>
<LI TYPE=1 VALUE=1>The UI thread attempted to start a transaction, and in so doing block on a Lock::AcquireRule waiting for a job to get the transaction lock on its behalf.
<LI TYPE=1 VALUE=2>This wasn't immediately available, so the Blocked UI Jobs dialog was shown to alert the user that there is some hold-up.
<LI TYPE=1 VALUE=3>Once the lock became available, the UI thread was granted the Lock::AcquireRule that it was waiting for and the dialog was taken down.
<LI TYPE=1 VALUE=4>The disappearance of the model dialog re-activated the workbench window, which in turn re-activated some part in that window.
<LI TYPE=1 VALUE=5>This part, on activation, attempts to start another transaction on the UI thread.&nbsp; However, a transaction is already in progress, so the second attempt to start is aborted by an InterruptException.
</OL>
I think this is quite what you would want to happen:&nbsp; the original transaction is protected against corruption by the re-entrant attempt to start another.&nbsp; It is unfortunate that a part activation listener is trying to start a transaction, but it should be aware that it is running on the UI thread and that it is therefore subject to interruption, from which it must recover somehow.&nbsp; There's just no way around that.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Tue, 2009-05-05 at 10:05 +0000, Alex Boyko wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi all,

While working on a diagram editor based on GMF I ran into a weird
exception (stack trace below).
Does anyone knows why it was thrown and what it means? Any ideas are
appreciated.
Thanks in advance.

Cheers,
Alex

java.lang.InterruptedException: Attempted to beginRule:
org.eclipse.emf.transaction.util.Lock$AcquireRule@2db02db, does not match
outer scope rule:
org.eclipse.emf.transaction.util.Lock$AcquireRule@1a0f1a0f
at org.eclipse.emf.transaction.util.Lock.uiSafeAcquire(Lock.jav a:475)
</PRE>
</BLOCKQUOTE>
<BR>
-----8&lt;-----<BR>
<BR>
</BODY>
</HTML>

--=-nPk27t+3mJqL0mGeR6A4--
Previous Topic:EMF/GMF creates -1 coordinates
Next Topic:adding java 5 annotations to a generated class-how to specify in the ecore model
Goto Forum:
  


Current Time: Thu Apr 25 09:53:35 GMT 2024

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

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

Back to the top