Exception while opening bpmn Editor After Mars.2 Update [message #1725874] |
Tue, 08 March 2016 08:20  |
Eclipse User |
|
|
|
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] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: Exception while opening bpmn Editor After Mars.2 Update [message #1725973 is a reply to message #1725970] |
Tue, 08 March 2016 17:58   |
Eclipse User |
|
|
|
Hello Robert,
Wow that was fast. 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 #1726033 is a reply to message #1725984] |
Wed, 09 March 2016 07:37   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
I'm planing on an update build for end of this week, so hang in there 
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   |
Eclipse User |
|
|
|
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.
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 #1727067 is a reply to message #1727063] |
Fri, 18 March 2016 14:39   |
Eclipse User |
|
|
|
Hello Robert,
That's a bad news in that case. 
- 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 #1727084 is a reply to message #1727083] |
Fri, 18 March 2016 17:44   |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06031 seconds