Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument:
Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #964867] Tue, 30 October 2012 17:15 Go to next message
Nigel Daniels is currently offline Nigel Daniels
Messages: 66
Registered: July 2009
Member
Hi,

I have been working on an RCP product that has multiple GMF plug-ins. I
started this in version 3.x and have migrated to Juno. Everything has
been fine until I added a Java based constraint to the gmfmap and
regenerated the plug-in.

Having regenerated this I now get an assertion error (See below)
whenever I add anything to the model, I suspect it is coming from the
added constraint code. The problem is stepping through the bulk of the
code has not indicated where the assertion is coming from. Has anyone
seen this or knows where this kind of error comes from?

Thanks, Nigel.

----------------------------------

!ENTRY org.eclipse.core.commands 4 2 2012-10-30 18:40:27.592
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.core.commands".
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
at
org.eclipse.core.commands.operations.AbstractOperation.hasContext(AbstractOperation.java:153)
at
org.eclipse.ui.operations.OperationHistoryActionHandler$HistoryListener.historyNotification(OperationHistoryActionHandler.java:141)
at
org.eclipse.core.commands.operations.DefaultOperationHistory$2.run(DefaultOperationHistory.java:941)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.notifyListeners(DefaultOperationHistory.java:930)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.notifyAdd(DefaultOperationHistory.java:992)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.add(DefaultOperationHistory.java:192)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:530)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:206)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:169)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
at
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
at
org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool.performCreation(CreationTool.java:133)
at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:189)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
at
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
at
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4134)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3980)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3619)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.routestovalue.rcp.intro.Application.start(Application.java:29)
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:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

!ENTRY org.eclipse.core.commands 4 2 2012-10-30 18:40:27.594
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.core.commands".
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
at
org.eclipse.core.commands.operations.AbstractOperation.hasContext(AbstractOperation.java:153)
at
org.eclipse.ui.operations.OperationHistoryActionHandler$HistoryListener.historyNotification(OperationHistoryActionHandler.java:141)
at
org.eclipse.core.commands.operations.DefaultOperationHistory$2.run(DefaultOperationHistory.java:941)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.notifyListeners(DefaultOperationHistory.java:930)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.notifyAdd(DefaultOperationHistory.java:992)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.add(DefaultOperationHistory.java:192)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:530)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:206)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:169)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
at
org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
at
org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool.performCreation(CreationTool.java:133)
at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:189)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
at
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
at
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4134)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3980)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3619)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.routestovalue.rcp.intro.Application.start(Application.java:29)
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:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Re: Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #965549 is a reply to message #964867] Wed, 31 October 2012 06:18 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

do you get the error when specifying an OCL constraint? What kind of constraint did you add? Link constraint? Expression Label? How does the constraint look like?

Ralph
Re: Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #965967 is a reply to message #965549] Wed, 31 October 2012 12:45 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel Daniels
Messages: 66
Registered: July 2009
Member
Hi Ralph,

thanks for getting back to me. I specified a link constraint using Java
following the tutorial here:

http://gmfsamples.tuxfamily.org/wiki/doku.php?id=gmf_tutorial5

in the section 'Diagram error management'. I have noted that exception
is thrown before the constraint code is called and seems to happen when
any diagrams related to the model are altered. I am beginning to suspect
the act of regenerating the diagram code has introduced the defect and
it may not be related to the added constraint.

Best regards,

Nigel

On 31/10/2012 10:18, Ralph Gerbig wrote:
> Hi,
>
> do you get the error when specifying an OCL constraint? What kind of
> constraint did you add? Link constraint? Expression Label? How does the
> constraint look like?
>
> Ralph
Re: Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #972185 is a reply to message #965967] Mon, 05 November 2012 07:28 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

if you think regenerating the code introduced did you try to DELTE your genmodel and source code and generate them from scratch?

Cheers,

Ralph
Re: Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #976318 is a reply to message #972185] Thu, 08 November 2012 08:38 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel Daniels
Messages: 66
Registered: July 2009
Member
Hi Ralph,

tracing the code it seems that there is a CompositeCommand being issued
from somewhere with a null IUndoContext. I have no idea at this stage
were it is coming from :-(

As my code is under source control and has a lot of modifications rather
than deleting everything I created a test project to recreate the issue
and tried that. This does not suffer the same issue so it seems the
problem is from the regeneration itself.

I'll hunt through the code and see where CompositeCommands are issued from.

Best regards,

Nigel

On 05/11/2012 12:28, Ralph Gerbig wrote:
> Hi,
>
> if you think regenerating the code introduced did you try to DELTE your
> genmodel and source code and generate them from scratch?
>
> Cheers,
>
> Ralph
Re: Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #976348 is a reply to message #976318] Thu, 08 November 2012 09:09 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

to prevent such problems in future I would suggest to copy your code in generation templates http://www.bonitasoft.org/blog/eclipse/customize-your-gmf-editor-by-customizing-templates/ or use GMF extension points for customization. You should never mix generated with hand written things no matter if it is EMF or GMF code or any generated model from e.g. EMF or GMF. Otherwise you will run very often into such problems. If you like to take a look for template examples you can see here: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/#svn%2Fde.uni_mannheim.informatik.swt.models.gmf%2Ftemplates%2Faspects . Tou can also customize a genmodel via a custom QVTo transforation an example can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/transformations/postRec.qvto

Ralph
Re: Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #976760 is a reply to message #976348] Thu, 08 November 2012 15:46 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel Daniels
Messages: 66
Registered: July 2009
Member
Hi Ralph,

This looks like a very interesting approach, I have some questions.

I'm curious how does this approach work with updates to GMF?
Is there a point where you have essentially forked the GMF codebase
through extensions?
Do the aspects have a version dependency?

If they do not then I suspect many of the changes I have made would be
suitable to move to this approach.

Best regards,

Nigel

On 08/11/2012 14:09, Ralph Gerbig wrote:
> Hi,
>
> to prevent such problems in future I would suggest to copy your code in
> generation templates
> http://www.bonitasoft.org/blog/eclipse/customize-your-gmf-editor-by-customizing-templates/
> or use GMF extension points for customization. You should never mix
> generated with hand written things no matter if it is EMF or GMF code or
> any generated model from e.g. EMF or GMF. Otherwise you will run very
> often into such problems. If you like to take a look for template
> examples you can see here:
> http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/#svn%2Fde.uni_mannheim.informatik.swt.models.gmf%2Ftemplates%2Faspects
> . Tou can also customize a genmodel via a custom QVTo transforation an
> example can be found here:
> http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/transformations/postRec.qvto
>
>
> Ralph
Re: Constraint causes - org.eclipse.core.runtime.AssertionFailedException: null argument: [message #977487 is a reply to message #976760] Fri, 09 November 2012 05:17 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

the templates can change between GMF version. However they do not seem to change a lot. On the other side if the templates you are customizng changes it will not make a lot of difference if you change the template or your handwritten @generate not code. What I use a lot is the targetDef.proceed() statement to only execute custom templates for things I want to customize. This saves you copying code which means that less can get broken when the original templates change. I have never forked the GMF code base through extension and I am not aware of any version dependencies.

Ralph
Previous Topic:Making figures sensitive to attributes of semantic elements
Next Topic:Popup-list for different relations
Goto Forum:
  


Current Time: Thu Jul 31 19:46:06 EDT 2014

Powered by FUDForum. Page generated in 0.04200 seconds