Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Broken diagram!
Broken diagram! [message #1697316] Wed, 03 June 2015 06:50 Go to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
When opening a (newly) drawn diagram I get the following error:

org.eclipse.uml2.uml.internal.impl.PackageImpl cannot be cast to org.eclipse.uml2.uml.Association

Can the diagram be salvaged, it was fairly complex?

The full error log:

java.lang.ClassCastException: org.eclipse.uml2.uml.internal.impl.PackageImpl cannot be cast to org.eclipse.uml2.uml.Association
at org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceRoleEditPart.getParserElement(AssociationLinkLabelSourceRoleEditPart.java:58)
at org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart.getLabelText(AbstractElementLabelEditPart.java:209)
at org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart.refreshLabel(AbstractElementLabelEditPart.java:439)
at org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart.refreshVisuals(AbstractElementLabelEditPart.java:430)
at org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart.setLabel(AbstractElementLabelEditPart.java:185)
at org.eclipse.papyrus.sysml.diagram.common.edit.part.AssociationEditPart.addFixedChild(AssociationEditPart.java:228)
at org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLinkEditPart.addChildVisual(AbstractElementLinkEditPart.java:82)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:211)
at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart.addChild(ConnectionEditPart.java:213)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:781)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:726)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:644)
at org.eclipse.gef.editparts.AbstractConnectionEditPart.refresh(AbstractConnectionEditPart.java:226)
at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart.access$1(ConnectionEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart$5.run(ConnectionEditPart.java:1127)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
at org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart.refresh(ConnectionEditPart.java:1124)
at org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart.refresh(ConnectionEditPart.java:88)
at org.eclipse.gef.editparts.AbstractConnectionEditPart.setSource(AbstractConnectionEditPart.java:286)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addSourceConnection(AbstractGraphicalEditPart.java:260)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshSourceConnections(AbstractGraphicalEditPart.java:697)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:645)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$3(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$3.run(GraphicalEditPart.java:861)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refresh(GraphicalEditPart.java:851)
at org.eclipse.papyrus.uml.diagram.common.editparts.UMLNodeEditPart.refresh(UMLNodeEditPart.java:87)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:253)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:223)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:212)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.addChild(GraphicalEditPart.java:1319)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:781)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:726)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:644)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$3(GraphicalEditPart.java:1)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$3.run(GraphicalEditPart.java:861)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.refresh(GraphicalEditPart.java:851)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:253)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:223)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:212)
at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(SimpleRootEditPart.java:105)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:617)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer.setContents(DiagramGraphicalViewer.java:352)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initializeGraphicalViewerContents(DiagramEditor.java:872)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.initializeGraphicalViewer(DiagramEditor.java:865)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.initializeGraphicalViewer(DiagramEditorWithFlyOutPalette.java:116)
at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.initializeGraphicalViewer(DiagramDocumentEditor.java:174)
at org.eclipse.papyrus.sysml.diagram.blockdefinition.part.BlockDefinitionDiagramEditor.initializeGraphicalViewer(BlockDefinitionDiagramEditor.java:497)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.createGraphicalViewer(DiagramEditor.java:807)
at org.eclipse.papyrus.sysml.diagram.blockdefinition.BlockDefinitionDiagramForMultiEditor.createGraphicalViewer(BlockDefinitionDiagramForMultiEditor.java:112)
at org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(GraphicalEditor.java:171)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.createPartControl(DiagramEditor.java:1580)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.createPartControl(DiagramEditorWithFlyOutPalette.java:328)
at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.createPartControl(DiagramDocumentEditor.java:1514)
at org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor.createPartControl(UmlGmfDiagramEditor.java:245)
at org.eclipse.papyrus.infra.core.sasheditor.internal.EditorPart.createEditorPartControl(EditorPart.java:297)
at org.eclipse.papyrus.infra.core.sasheditor.internal.EditorPart.createPartControl(EditorPart.java:199)
at org.eclipse.papyrus.infra.core.sasheditor.internal.TabFolderPart.createChildPart(TabFolderPart.java:1065)
at org.eclipse.papyrus.infra.core.sasheditor.internal.TabFolderPart.createTabItem(TabFolderPart.java:986)
at org.eclipse.papyrus.infra.core.sasheditor.internal.TabFolderPart.synchronize2(TabFolderPart.java:900)
at org.eclipse.papyrus.infra.core.sasheditor.internal.RootPart.synchronize2(RootPart.java:139)
at org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer.refreshTabsInternal(SashWindowsContainer.java:671)
at org.eclipse.papyrus.infra.core.sasheditor.internal.SashWindowsContainer.refreshTabs(SashWindowsContainer.java:625)
at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor.doRefreshTabs(AbstractMultiPageSashEditor.java:212)
at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor.access$0(AbstractMultiPageSashEditor.java:210)
at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor$1.run(AbstractMultiPageSashEditor.java:205)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734)
at org.eclipse.papyrus.infra.core.sasheditor.editor.AbstractMultiPageSashEditor.refreshTabs(AbstractMultiPageSashEditor.java:201)
at org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor.refreshTabs(CoreMultiDiagramEditor.java:1123)
at org.eclipse.papyrus.infra.core.editor.CoreMultiDiagramEditor$5.run(CoreMultiDiagramEditor.java:1112)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
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:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)


Regards,
Tomas
Re: Broken diagram! [message #1697324 is a reply to message #1697316] Wed, 03 June 2015 07:58 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Tomas,

Quote:
Can the diagram be salvaged, it was fairly complex?


The diagram is not lost. There are two solutions to retrieve it:

- Modify the model to avoid the error (May be difficult and risky)
- Fix the bug in Papyrus to solve the error

The second option should be easy in this case, but will require you to update to the latest nightly build. Which version of Papyrus are you using?

Regards,
Camille


Camille Letavernier
Re: Broken diagram! [message #1697345 is a reply to message #1697324] Wed, 03 June 2015 10:22 Go to previous messageGo to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
Hi Camille!

I'm using the SR1a release since SR2 by some unknown reason is very slow with my main model.

Regards,
Tomas
Re: Broken diagram! [message #1697372 is a reply to message #1697345] Wed, 03 June 2015 13:44 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Tomas,

This kind of error happens when the (Notation) model becomes invalid. The actual source of the error is hard to detect at this point (It is already too late), so we can just either try to repair the model (by removing the invalid element), or improve the robustness of Papyrus so that it doesn't crash on this invalid element.

I can confirm that the bug is still present in Mars, so I can fix it in both Luna and Mars, but you will have to update to either Luna SR2 nightly or Papyrus Mars to benefit from the fix. If you need to use Luna SR1, then I'd recommend the following steps:

- Wait for the fix to be pushed (I'm currently looking into it)
- Install Papyrus Luna SR2 nightly
- Open your model in this version
- Remove the invalid Association link (Probably marked with a "No smoking" sign or something like that in the diagram)
- Reopen your model in Luna SR1a

I've opened Bug 469280 to track the issue

Bug 469280: [SysML Diagrams] ClassCastException in AssociationLinkLabelSourceRoleEditPart
https://bugs.eclipse.org/bugs/show_bug.cgi?id=469280

Regards,
Camille


Camille Letavernier
Re: Broken diagram! [message #1697388 is a reply to message #1697372] Wed, 03 June 2015 14:22 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

Bug 469280 is now fixed on Luna (SR2 nightly) and Mars (Post-RC3). I've started a new Luna build to deploy this fix. Since our official Luna build is not maintained anymore, you need to use a different update site to get this fix:

https://hudson.eclipse.org/papyrus/job/Papyrus-Luna/lastSuccessfulBuild/artifact/releng/main/target/repository

Regards,
Camille


Camille Letavernier
Re: Broken diagram! [message #1697451 is a reply to message #1697372] Thu, 04 June 2015 04:41 Go to previous messageGo to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
Hi Camille!

I have installed the fix, but I'm experiencing some oddities with the broken association(s), because according to the properties inspector, these elements, shown as connecting lines (see screen shot 1) are infact the package in which the diagram reside (see screen shot 2).

Now, deletion is not an option (tried that) because that results in the deletion of the entire structure and its childs and diagrams.

And I can't trigger a change into a real association either by trying to connect the line to another element.

Should Hide element be sufficient to clear up this but does Hide mean that there will still be some form of invalid "connection" within the diagram file?

Screen shot 1:
index.php/fa/22079/0/

Screen shot 2:
index.php/fa/22080/0/

Regards,
Tomas

[Updated on: Thu, 04 June 2015 04:46]

Report message to a moderator

Re: Broken diagram! [message #1697466 is a reply to message #1697451] Thu, 04 June 2015 08:20 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Tomas,

The default behavior in GMF (which we try to override in top-level elements) is that, if a graphical element is not related to a semantic element, then it looks for the semantic element of its parent. Since the Association has been deleted, the dangling association link looks for the semantic element of its graphical parent, which is a Package.

We try to avoid that in Papyrus, but SysML Diagrams are still not properly aligned with UML ones, and we still see this undesirable behavior. The solution in this case is indeed to "HIde" the link ("Delete from Diagram").

Camille


Camille Letavernier
Re: Broken diagram! [message #1697473 is a reply to message #1697466] Thu, 04 June 2015 09:12 Go to previous messageGo to next message
Tomas Sandkvist is currently offline Tomas SandkvistFriend
Messages: 149
Registered: October 2013
Senior Member
Thanks Camille!

It all worked out for the best.

Regards,
Tomas
Re: Broken diagram! [message #1759891 is a reply to message #1697473] Wed, 19 April 2017 15:11 Go to previous message
Kanwal Gill is currently offline Kanwal GillFriend
Messages: 16
Registered: February 2017
Junior Member
hey guys, I am experiencing a similar problem. Where I have copied some nodes of a model file and am coping into another model file (CSSDiagramImpl) type...

The nodes and their edges do get perfectly copied with all the XML/XMI details. If I check the XMI file then they are very similar to the original, BUT at the time of viewing that file AS A DIAGRAM, it gives broken diagram.

Any idea why is it so? I am trying to break the Henshin Models, i.e. breaking 1 model into 2 or 3 models
Previous Topic:Error message while installing Moka
Next Topic:Papyrus Customization. Viewpoints - problem with Implementation ID in Diagram Specification.
Goto Forum:
  


Current Time: Fri Apr 19 00:40:34 GMT 2024

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

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

Back to the top