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

Bug 337134

Summary: [Export Action] [Papyrus Integration] Export As XMI file generate an Exception
Product: z_Archived Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: EMF-FacetAssignee: Gregoire Dupe <gdupe>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: emft.facet-inbox, gdupe
Version: unspecifiedFlags: gdupe: indigo+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Bug 337164 fix gdupe: iplog+

Description Vincent Lorenzo CLA 2011-02-14 10:06:08 EST
When I want to export my Papyrus table in a XMI file, I get the following exception : 
I think the save action should be done with an EMF Transaction

!ENTRY org.eclipse.ui 4 0 2011-02-14 16:04:25.744
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalStateException: Cannot modify resource set without a write transaction
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processResourceNotification(TransactionChangeRecorder.java:272)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:238)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380)
	at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1033)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:305)
	at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
	at org.eclipse.emf.facet.widgets.nattable.NatTableWidget.saveAs(NatTableWidget.java:2202)
	at org.eclipse.emf.facet.widgets.nattable.handlers.ExportCommandHandler.execute(ExportCommandHandler.java:29)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:824)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:810)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:800)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4126)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3715)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2697)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2661)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2495)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Nicolas Guyomar CLA 2011-02-16 11:44:01 EST
Created attachment 189113 [details]
Bug 337164 fix

Hi,

Please find attached a patch on revision 316 which should fix this problem.

Regards,
Nicolas Guyomar
Comment 2 Gregoire Dupe CLA 2011-02-17 08:48:04 EST
Comment on attachment 189113 [details]
Bug 337164 fix

Hi,

I’ve committed this patch (less than 250 line, no CQ needed).

Committed revision 321.

Regards,
Gregoire
Comment 3 Gregoire Dupe CLA 2011-02-17 09:32:53 EST
Vincent,

This patch is available in the last nightly build of EMF Facet. Please can you:
 - Install the last version from the update site http://download.eclipse.org/facet/updates/nightly/
 - Try to reproduce the bug.

Regards,
Gregoire
Comment 4 Vincent Lorenzo CLA 2011-02-21 06:00:23 EST
Hi, I have tested with the version on the update site, the patch doesn't correct the bug.
I get the same exception

Regards, 
Vincent
Comment 5 Gregoire Dupe CLA 2011-02-23 11:47:23 EST
Hi,

Please, can you send us a scenario to reproduce the bug and if necessary a zip of your Eclipse installation and of your workspace.

Regards,
Gregoire Dupe
Comment 6 Vincent Lorenzo CLA 2011-02-24 04:04:35 EST
Hi, 
   Papyrus Table Editor are now available on the Papyrus SVN in /trunk/incoming.
   
   You need : 
   		- oep.table.common : common plugin for the table editors
   		- oep.table.menu : menu for the tables
   		- oep.table.default  : the default table editor
   		- oep.table.modelexplorer : allow to display tables in the model explorer + provides some actions like Rename, Duplicate, ...
   
Steps to reproduce : 
	1/ Create a new Papyrus diagram and add it some elements
	2/ Create a new default table : 
			right click in the model explorer on the root element -> New Table -> Default Table
			a new table is open
	3/ Add an element in the table ( drag & drop is not yet done) :
		From the model explorer : right click on a UML element -> Add in a table
	4/ Use the action Export as XMI file -> you get the exception.
Comment 7 Vincent Lorenzo CLA 2011-03-16 05:14:08 EDT
This bug is resolved. The last problems came from my Eclipse and Papyrus Installation.