| Summary: | Null pointer exception when generate code from a gmfgen | ||
|---|---|---|---|
| Product: | [Modeling] GMF-Tooling | Reporter: | Patrick Tessier <Patrick.Tessier> |
| Component: | Core | Assignee: | Project Inbox <gmp.gmf-tooling-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | blocker | ||
| Priority: | P3 | CC: | arthur.daussy, borlander, mistria |
| Version: | unspecified | ||
| Target Milestone: | 2.4 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Hello, I trying to regenerate the Activity Diagram in MDT Papyrus and I think I may have I have seen the same problem when using GMF Tooling 2.4. It's due to an error in QVTO. This error was corrected with the version 3.1.0. The problem is that GMF Tooling dependencies used QVTO [2.0.0,3.0.0). The solution is then to use a custom GMF Tooling feature. I will put it in attachment and you can try it if you want. But there still a lot of problem still after. After some searching some times I found this bug and I think it might be related. See https://bugs.eclipse.org/bugs/show_bug.cgi?format=multiple&id=346952. Hoping it will help you. Here you can find the custom GMF Tooling: http://dl.dropbox.com/u/1059994/GMFToolingFeature.zip Here you can find the 3.1.0 QVTO version: http://dl.dropbox.com/u/1059994/m2m-qvtoml-Update-3.1.0RC1.zip Can you please tell us where you got your version of GMF-Tooling 2.4? Maybe it was not up-to-date... Also can you please describe us the steps to reproduce the issue? Is this simply about checkout a gmfgen and running the generation? We could probably incorporate your model to GMF Tooling test suite... Hi, First thanks you for answering so quickly. I have taken the GMF Tooling from: GMP - http://download.eclipse.org/modeling/gmp/updates/milestones/site.xml with this version I got the NPE describe by Patrick Tessier. So I have look for an upgrade of QVTO. And I have found the 3.1.0 version that should correct the bug. But with the GMF Tooling version I have got from the update site I didn't succeed in using QVTO 3.1. So I have downloaded sources from the CVS and on this version the depencies were correct. So I have exported the feature and install it. Ok, I got it. You seem to clearly understand the issue. Can you provide a patch that you used to fix the issue? If it looks good, I'll commit it, run the test, and it will be part of the 2.4 release. If you can't, we'll do the necessary for getting this fixed for the release, but it won't be immediate. Nothing has to be corrected because on the CVS version the dependencies are correct but the no existing build with this correction. So I simply build the GMF Tooling feature and use it with QVTO 3.1. However the real problem is that with GMF 2.4 I got this error: Description Resource Path Location Type IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@107c32f (eClass: org.eclipse.emf.ecore.impl.EClassImpl@6be589 (name: GenChildSideAffixedNode) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/org.eclipse.papyrus.diagram.activity/model/activityDiagram.gmfgen, 13162, 843) activityDiagram.gmfgen /org.eclipse.papyrus.diagram.activity/model line 13162, column 843 Problem and I think it is related to the bug: https://bugs.eclipse.org/bugs/show_bug.cgi?format=multiple&id=346952 Moreover with this version I get the following error when I try to generate. I do not get this error when I try to generate with GMF Tooling 2.3.0 version. Bec from map to gen: null Error Fri Jun 17 15:34:44 CEST 2011 The object 'org.eclipse.gmf.codegen.gmfgen.impl.GenChildSideAffixedNodeImpl@41c998 (visualID: 3059, editPartClassName: ActivityParameterNodeEditPart, itemSemanticEditPolicyClassName: ActivityParameterNodeItemSemanticEditPolicy, notationViewFactoryClassName: ActivityParameterNodeViewFactory) (canonicalEditPolicyClassName: ActivityParameterNodeCanonicalEditPolicy) (primaryDragEditPolicyQualifiedClassName: null, graphicalNodeEditPolicyClassName: ActivityParameterNodeGraphicalNodeEditPolicy, createCommandClassName: ActivityParameterNodeCreateCommand) (preferredSideName: WEST)' is not contained in a resource. org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object 'org.eclipse.gmf.codegen.gmfgen.impl.GenChildSideAffixedNodeImpl@41c998 (visualID: 3059, editPartClassName: ActivityParameterNodeEditPart, itemSemanticEditPolicyClassName: ActivityParameterNodeItemSemanticEditPolicy, notationViewFactoryClassName: ActivityParameterNodeViewFactory) (canonicalEditPolicyClassName: ActivityParameterNodeCanonicalEditPolicy) (primaryDragEditPolicyQualifiedClassName: null, graphicalNodeEditPolicyClassName: ActivityParameterNodeGraphicalNodeEditPolicy, createCommandClassName: ActivityParameterNodeCreateCommand) (preferredSideName: WEST)' is not contained in a resource. at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.endSave(XMLSaveImpl.java:307) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:271) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:333) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1423) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1137) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:978) at org.eclipse.gmf.internal.bridge.transform.TransformToGenModelOperation.save(TransformToGenModelOperation.java:487) at org.eclipse.gmf.internal.bridge.transform.TransformToGenModelOperation.executeTransformation(TransformToGenModelOperation.java:284) at org.eclipse.gmf.internal.bridge.transform.TransformToGenModelWizard$1.run(TransformToGenModelWizard.java:161) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029) at org.eclipse.gmf.internal.bridge.transform.TransformToGenModelWizard.performFinish(TransformToGenModelWizard.java:164) at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) 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:4163) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.gmf.internal.bridge.transform.TransformToGenModelAction.run(TransformToGenModelAction.java:72) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) 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:4163) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) 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:123) 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) Caused by: org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'org.eclipse.gmf.codegen.gmfgen.impl.GenChildSideAffixedNodeImpl@41c998 (visualID: 3059, editPartClassName: ActivityParameterNodeEditPart, itemSemanticEditPolicyClassName: ActivityParameterNodeItemSemanticEditPolicy, notationViewFactoryClassName: ActivityParameterNodeViewFactory) (canonicalEditPolicyClassName: ActivityParameterNodeCanonicalEditPolicy) (primaryDragEditPolicyQualifiedClassName: null, graphicalNodeEditPolicyClassName: ActivityParameterNodeGraphicalNodeEditPolicy, createCommandClassName: ActivityParameterNodeCreateCommand) (preferredSideName: WEST)' is not contained in a resource. at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingHREF(XMLHelperImpl.java:760) at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getURIFragment(XMLHelperImpl.java:731) at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getIDREF(XMLHelperImpl.java:753) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveIDRefMany(XMLSaveImpl.java:2019) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1366) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1220) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2709) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1177) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1038) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2410) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1549) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1220) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2709) at org.eclipse.emf.ecore.xmi.impl.XMISaveImpl.writeTopObjects(XMISaveImpl.java:90) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:595) at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:257) ... 50 more The version you used is indeed not up-to-date. Just to be sure: Is everything fine when using the feature built from the current sources? (the one you linked on the dropbox) If yes, please open a new bug. Otherwise, please mark this bug as resolved. By the way you can get some non-official builds of GMF Tooling 2.4.0 here => https://hudson.eclipse.org/hudson/job/tycho-gmp.gmf.tooling/ (In reply to comment #6) > > Moreover with this version I get the following error when I try to generate. > I do not get this error when I try to generate with GMF Tooling 2.3.0 version. > Bec > from map to gen: > > > null > Error > Fri Jun 17 15:34:44 CEST 2011 > The object > 'org.eclipse.gmf.codegen.gmfgen.impl.GenChildSideAffixedNodeImpl@41c998 > (visualID: 3059, editPartClassName: ActivityParameterNodeEditPart, > itemSemanticEditPolicyClassName: ActivityParameterNodeItemSemanticEditPolicy, > notationViewFactoryClassName: ActivityParameterNodeViewFactory) > (canonicalEditPolicyClassName: ActivityParameterNodeCanonicalEditPolicy) > (primaryDragEditPolicyQualifiedClassName: null, > graphicalNodeEditPolicyClassName: ActivityParameterNodeGraphicalNodeEditPolicy, > createCommandClassName: ActivityParameterNodeCreateCommand) (preferredSideName: > WEST)' is not contained in a resource. Arthur, could you please point me to the input resources to reproduce this issue? Assuming it may be a common problem with side-affixed nodes, I've tried that with minimal diagram with pin-like structurtes but it works fine for me, so it may be related to the specifics of your diagram. Thanks for your help but after updating all needed features the bug has diseapered. If I find it again I will go back to you. Thanks a lot. Arthur Closing as fixed. version -> 2.4 Rollback, Set target to 2.4 instead of accidenatlly set Version |
I obtain the following message when I try to generate java.lang.NullPointerException at org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.<init>(EcoreEvaluationEnvironment.java:117) at org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvaluationEnv.<init>(QvtOperationalEvaluationEnv.java:72) at org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEnvFactory.createEvaluationEnvironment(QvtOperationalEnvFactory.java:129) at org.eclipse.gmf.internal.xpand.model.ExecutionContextImpl.createEvaluationEnvironment(ExecutionContextImpl.java:305) at org.eclipse.gmf.internal.xpand.model.ExecutionContextImpl.createEvaluationVisitor(ExecutionContextImpl.java:281) at org.eclipse.gmf.internal.xpand.ocl.ExpressionHelper.evaluate(ExpressionHelper.java:98) I use indigo M5 gmf Version: 2.3.0.v20100508-1742-777B-95pDcLakRvph3PMwwfmjSTZ Build id: 201102031241 In the class org.eclipse.gmf.internal.xpand.model.ExecutionContextImpl you have written: private EcoreEvaluationEnvironment createEvaluationEnvironment() { if (envFactory == null) { getOCLEnvironment(); } EcoreEvaluationEnvironment ee = QvtOperationalEnvFactory.INSTANCE.createEvaluationEnvironment(new Context(), null); <-- But null is forbidden because you call at the end org.eclipse.ocl.ecore.EcoreEvaluationEnvironment see the code of the constructor /** * Initializes me with my parent evaluation environment (nesting scope). * * @param parent * my parent (nesting scope); must not be <code>null</code> */ public EcoreEvaluationEnvironment( EvaluationEnvironment<EClassifier, EOperation, EStructuralFeature, EClass, EObject> parent) { super(parent); EcoreEvaluationEnvironment ecoreParent = (EcoreEvaluationEnvironment) parent; this.factory = ecoreParent.factory; this.oppositeEndFinder = ecoreParent.oppositeEndFinder; }