Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Exception while opening bpmn Editor After Mars.2 Update(BPMN Editor Opening Issue)
Exception while opening bpmn Editor After Mars.2 Update [message #1725874] Tue, 08 March 2016 08:20 Go to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello,

We are experiencing an issue wrt opening the bpmn2 visual editor for bpmn based model after update of Mars.2.
While digging further into the problem we see that if editor input resource xml is not containing the targetNamespace value then only this problem happens. Manually putting the targetNamespace into the file starts opening the editor
but this makes our old model incompatible since none of them contain this targetNamespace attributes this was not required so far.

We retest the same resource against Mars.1 updates and it's working fine, only with Mars.2 whatever updates have come into bpmn-modeler is causing the issue.
Could you please point us what can be done to avoid and fix this issue so that visual editor can be opened successfully for the models which do not contain targetNamespace by default.

Following is the exception trace which is thrown while opening the editor.
java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl cannot be cast to org.eclipse.bpmn2.Definitions
at org.eclipse.bpmn2.modeler.core.model.ModelHandler.getDefinitions(ModelHandler.java:720)
at org.eclipse.bpmn2.modeler.core.model.ModelHandler.getDefinitions(ModelHandler.java:716)
at org.eclipse.bpmn2.modeler.core.di.DIImport$1.doExecute(DIImport.java:134)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:127)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
at org.eclipse.bpmn2.modeler.core.di.DIImport.generateFromDI(DIImport.java:129)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2Editor.importDiagram(DefaultBPMN2Editor.java:248)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2Editor$EditorInputHelper$1.doExecute(DefaultBPMN2Editor.java:928)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:516)
at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:96)
at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2Editor$EditorInputHelper.importDiagram(DefaultBPMN2Editor.java:925)
at org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor$ExtendedEditorInputHelper.importDiagram(BPMN2Editor.java:545)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2Editor$EditorInputHelper.postSetInput(DefaultBPMN2Editor.java:917)
at org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor$ExtendedEditorInputHelper.postSetInput(BPMN2Editor.java:536)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2Editor.setInput(DefaultBPMN2Editor.java:213)
at org.eclipse.graphiti.ui.editor.DiagramEditor.init(DiagramEditor.java:224)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2Editor.init(DefaultBPMN2Editor.java:163)
at org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor.init(BPMN2Editor.java:97)

[Updated on: Tue, 08 March 2016 09:43]

Report message to a moderator

Re: Exception while opening bpmn Editor After Mars.2 Update [message #1725912 is a reply to message #1725874] Tue, 08 March 2016 13:44 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

This is a regression, please file a bugzilla report here: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=BPMN2Modeler

Can you please post the <definitions> element from one of your BPMN2 files here?

Thanks!
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1725941 is a reply to message #1725912] Tue, 08 March 2016 15:12 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

Thanks for the reply, As suggested i have filed a buzilla report https://bugs.eclipse.org/bugs/show_bug.cgi?id=489223

Sample definitions tags looks as following :

<bpmn2:definitions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
id="Definitions_1" name="Definitions 1"
>

Let me know if you need any further details.

--
Thanks and Regards,
Bhuvan Mehta

[Updated on: Tue, 08 March 2016 15:17]

Report message to a moderator

Re: Exception while opening bpmn Editor After Mars.2 Update [message #1725970 is a reply to message #1725941] Tue, 08 March 2016 17:11 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

This was an easy one. Can you please try installing the nightly build from the update site here:

http://download.eclipse.org/bpmn2-modeler/updates/nightly/mars

and test to make sure there are no other regressions.

Thanks!
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1725973 is a reply to message #1725970] Tue, 08 March 2016 17:58 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

Wow that was fast. Smile Thanks a lot.
I tested with provided update site and it started working again as exacted like earlier. Will be continuing to do thorough testing and will let you know if any issue.

However two imp questions :
1. Can this fix be made available in Mars.2, if yes then what would be earliest timeline for the same? As it's very critical for us.

2. On opening the editor i see another issue now of stackoverflow beling thrown from diagrambehaviour however i am able to get rid of it by overriding selectPictogramElements with empty implementation. Not sure if that's completely correct.
Please recommend if it should be handled otherwise or needs fix as well?

Stacktrace below :
java.lang.StackOverflowError
at java.util.HashMap.hash(Unknown Source)
at java.util.HashMap.containsKey(Unknown Source)
at java.util.Collections$SynchronizedMap.containsKey(Unknown Source)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:235)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:258)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:258)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:258)
at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:258)
at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:213)
at org.eclipse.e4.core.commands.ExpressionContext.getAllowPluginActivation(ExpressionContext.java:66)
at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:97)
at org.eclipse.e4.ui.internal.workbench.ContributionsAnalyzer.isVisible(ContributionsAnalyzer.java:256)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarContributionRecord.computeVisibility(ToolBarContributionRecord.java:126)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarContributionRecord.updateVisibility(ToolBarContributionRecord.java:70)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$5.changed(ToolBarManagerRenderer.java:478)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:114)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:341)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:356)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$7.changed(SelectionAggregator.java:229)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:114)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:341)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:356)
at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.setSelection(SelectionServiceImpl.java:31)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.selectionChanged(CompatibilityPart.java:441)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:247)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer$1.run(AbstractEditPartViewer.java:131)
at org.eclipse.gef.SelectionManager.fireSelectionChanged(SelectionManager.java:156)
at org.eclipse.gef.SelectionManager.setSelection(SelectionManager.java:314)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setSelection(AbstractEditPartViewer.java:751)
at org.eclipse.graphiti.ui.internal.editor.GraphitiScrollingGraphicalViewer.setSelection(GraphitiScrollingGraphicalViewer.java:72)
at org.eclipse.graphiti.ui.editor.DiagramBehavior.selectPictogramElements(DiagramBehavior.java:890)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2EditorDiagramBehavior.selectPictogramElements(DefaultBPMN2EditorDiagramBehavior.java:66)
at org.eclipse.graphiti.ui.editor.DiagramEditor.selectPictogramElements(DiagramEditor.java:662)
at org.eclipse.bpmn2.modeler.ui.editor.DefaultBPMN2Editor.selectionChanged(DefaultBPMN2Editor.java:668)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:237)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.handleSelectionChanged(SelectionService.java:107)
at org.eclipse.ui.internal.e4.compatibility.SelectionService.access$0(SelectionService.java:91)
at org.eclipse.ui.internal.e4.compatibility.SelectionService$1.selectionChanged(SelectionService.java:66)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$2.run(SelectionAggregator.java:126)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.notifyListeners(SelectionAggregator.java:123)


--
Thanks and Regards,
Bhuvan Mehta
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1725984 is a reply to message #1725973] Tue, 08 March 2016 20:23 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

This looks like a side effect of a fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=488131 but I'm having difficulty reproducing the stack overflow. Would it be possible to share the bpmn2 file with me? If not, can you trim it down to the smallest possible file that causes the problem?
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1726033 is a reply to message #1725984] Wed, 09 March 2016 07:37 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

Unfortunately exception is occurring only in our editor where stacktrace points to selectPictogramElements from diagrambehaviour class. However as suggested overriding the method seems to help in getting rid of issue.

What's more important at the movement is when could the hotfix for original issue of targetNamespace and editor opening be made available for Mars.2?
Could you please let know the timeline for the same?

--
Thanks and Regards,
Bhuvan Mehta
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1726104 is a reply to message #1726033] Wed, 09 March 2016 15:41 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I'm planing on an update build for end of this week, so hang in there Wink

It appears that the stack overflow is being caused by a modification of the selection list in the editor. The intention was to remove "Label Shapes" from the selection list, since these are owned by their ContainerShapes. This prevents Graphiti from trying to delete a shape that is no longer attached to the model (see Bug 488131)

Can you try adding a flag to lock out repeated calls from the editor to super.selectionChanged() in your working version of the DefaultBPMN2Editor class? Something like this:

	private boolean selectionChanging;

	@Override
	public synchronized void selectionChanged(IWorkbenchPart part, ISelection selection) {
		if (!selectionChanging) {
			try {
				selectionChanging = true;
				// Filter out label shapes as these are controlled by their ContainerShape owners
				// For example a "Select All" key action would select Labels as well.
				Iterator iter = ((IStructuredSelection)selection).iterator();
				List<Object> filteredObjects = new ArrayList<Object>();
				List<PictogramElement> pictogramElements = new ArrayList<PictogramElement>();
				while (iter.hasNext()) {
					boolean addIt = true;
					Object o = iter.next();
					if (o instanceof EditPart) {
						Object model = ((EditPart)o).getModel();
						if (model instanceof PictogramElement) {
							if (FeatureSupport.isLabelShape((PictogramElement)model)) {
								addIt = false;
							}
							else {
								pictogramElements.add((PictogramElement)model);
							}
						}
					}
					if (addIt)
						filteredObjects.add(o);
				}
				IStructuredSelection filteredSelection = new StructuredSelection(filteredObjects);
		
				// Graphiti understands multipage editors
				// but apparently GEF doesn't
				super.selectionChanged(part,filteredSelection); // Graphiti's DiagramEditorInternal
				super.selectPictogramElements(pictogramElements.toArray(new PictogramElement[pictogramElements.size()]));
				
				updateActions(getSelectionActions()); // usually done in GEF's GraphicalEditor
			}
			finally {
				selectionChanging = false;
			}
		}
	}



and let me know if that works for you.

Bob
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1726114 is a reply to message #1726104] Wed, 09 March 2016 17:39 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Bob,

Thanks, that's good news.

Coming to StackOverflow problem, i tried the code snippet shared by you and
Superb, It does work and solves the issue of stackoverflow as well.
Ofc after this there is no need of dummy override of selectPictogramElements method from DiagramBehavior class.

Again thanks for assisting and providing solution for both the problems reported in this thread. Smile
Now waiting for consuming the fix from update build, just let us know once it's available.

--
Thanks and Regards,
Bhuvan Mehta
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1726655 is a reply to message #1726114] Tue, 15 March 2016 11:22 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

Any update on hotfix availability of fixes in Mars.2 from bpmn?

--
Thanks and Regards,
Bhuvan Mehta
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1726835 is a reply to message #1726655] Wed, 16 March 2016 19:06 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I am still working on some additional (unrelated) bugs that I want to include in this new service release which will be version 1.2.4. I will post more info on this forum and mailing list when it's available.
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1726969 is a reply to message #1726835] Thu, 17 March 2016 19:43 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi all,

We have a new Mars compatible build for BPMN2 Modeler available from the update site here:

http://download.eclipse.org/bpmn2-modeler/updates/mars/1.2.4

The list of bug fixes can be found on the New & Noteworthy pages.

Cheers!
Bob
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1727050 is a reply to message #1726969] Fri, 18 March 2016 13:17 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

Thanks for the update. How and when does this get available as part of default Mars. 2 update?
Such as user doesn't have need to install specific versioned update site for bpmn.

--
Thanks and Regards,
Bhuvan Mehta
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1727063 is a reply to message #1727050] Fri, 18 March 2016 14:17 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

As long as you have http://download.eclipse.org/bpmn2-modeler/updates/mars/1.2.4/ as one of your "Available Software Sites" you should be able to get the update when you "Check for Updates". Unfortunately these updates will not be picked up by the Eclipse Mars release until SR3 when and if there is one.
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1727067 is a reply to message #1727063] Fri, 18 March 2016 14:39 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

That's a bad news in that case. Sad
- I do not see any plan for SR3 for Mars from https://wiki.eclipse.org/Mars/Simultaneous_Release_Plan#Update_Releases.
- Isn't there any process for Eclipse Projects to provide hotfixes which can be made part of Eclipse update itself? How does Critical issues are handled and supported?

For consumers of our features we do not ask user to modify "Available Software Sites" since all the needed dependencies are automatically downloaded from Eclipse update site and there are no dependencies which are required to be fetched outside the Eclipse p2 installation base.

In case it's impossible to get the latest fixes from bpmn to be made available into Mars.2 then what would be the alternative you would suggest where in we need not ask for user innervation for updating "Available Software site" during installing of our features and user also gets the much needed fixes so that functionalities can work as expected?

--
Thanks and Regards,
Bhuvan Mehta
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1727083 is a reply to message #1727067] Fri, 18 March 2016 17:39 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

You could provide your own Eclipse Package with the editor pre-installed and have your customers download it from your servers or perhaps github?
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1727084 is a reply to message #1727083] Fri, 18 March 2016 17:44 Go to previous messageGo to next message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

Thanks for the reply, unfortunately that might not work out as so far it's been to download eclipse from eclipse site and just install needed features using p2 on top of it and everything else needed gets fetched from eclipse.

Is there a way to hook in or inject an update site into available software sites during p2 repo installation?

--
Thanks and Regards,
Bhuvan Mehta
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1727091 is a reply to message #1727084] Fri, 18 March 2016 19:15 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I'm not sure...if you figure out a way, please let me know.

[Updated on: Fri, 18 March 2016 19:16]

Report message to a moderator

Re: Exception while opening bpmn Editor After Mars.2 Update [message #1730079 is a reply to message #1727091] Thu, 21 April 2016 09:45 Go to previous message
Bhuvan Mehta is currently offline Bhuvan MehtaFriend
Messages: 58
Registered: July 2009
Member
Hello Robert,

Fortunately we found a way out to address the need of adding an entry for P2 site into associate sites preference which can be picked up during installation.
Option (b) would be recommended one as it doesn't not deal with low level ant based manipulation for achieving the same. We did try it out and does work for our use case.
Same was discussed and can be referenced from below thread :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=391033#c6

a) Ant [0] called from Maven, using a properties [1] file:

[0] https://github.com/jbosstools/jbosstools-build-sites/blob/master/aggregate/build.xml (see add.associate.sites)
[1] https://github.com/jbosstools/jbosstools-build-sites/blob/master/aggregate/webtools-site/associate.properties

b) Maven calling a custom mojo [2], with configuration [3] in a pom:

[2] https://github.com/jbosstools/jbosstools-maven-plugins/blob/master/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator/GenerateRepositoryFacadeMojo.java

[3] https://github.com/jbosstools/jbosstools-integration-tests/blob/master/site/pom.xml (see <associateSites> )

--
Thanks and Regards,
Bhuvan Mehta

[Updated on: Thu, 21 April 2016 09:47]

Report message to a moderator

Next Topic:Creating new features in my elements for some actions
Goto Forum:
  


Current Time: Thu Apr 25 16:17:18 GMT 2024

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

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

Back to the top