Home » Modeling » EMF » Null pointer exception in EStructuralFeatureImpl.getSettingDelegate(null pointer exception)
| | | |
Re: Null pointer exception in EStructuralFeatureImpl.getSettingDelegate [message #1190606 is a reply to message #1187930] |
Sat, 16 November 2013 12:54   |
Eclipse User |
|
|
|
Ed,
Thanks for the pointers. I have found the "dodgy" profile and it was some MagicDraw customisation profile. I have removed that one, but now I have another problem. The error I get is when trying to cast from EAttributeImpl to EReference. Here is the stack trace. I've looked around for this one and there is one bug report linked to this issue. So, is this really an Eclipse bug, or is there another problem with MagicDraw export.
Thanks a lot.
Thread [main] (Suspended (exception ClassCastException))
SAXXMIHandler(XMLHandler).setAttribValue(EObject, String, String) line: 2729
SAXXMIHandler.handleObjectAttribs(EObject) line: 79
SAXXMIHandler(XMLHandler).createObjectFromFactory(EFactory, String) line: 2200
SAXXMIHandler(XMLHandler).createObjectByType(String, String, boolean) line: 1337
SAXXMIHandler(XMLHandler).createTopObject(String, String) line: 1475
SAXXMIHandler(XMLHandler).processElement(String, String, String) line: 1026
SAXXMIHandler(XMIHandler).processElement(String, String, String) line: 81
SAXXMIHandler(XMLHandler).startElement(String, String, String) line: 1008
SAXXMIHandler(XMLHandler).startElement(String, String, String, Attributes) line: 719
SAXXMIHandler(XMIHandler).startElement(String, String, String, Attributes) line: 163
SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName, XMLAttributes, Augmentations) line: 509
SAXParserImpl$JAXPSAXParser(AbstractXMLDocumentParser).emptyElement(QName, XMLAttributes, Augmentations) line: 182
XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanStartElement() line: 1350
XMLDocumentScannerImpl$ContentDriver(XMLDocumentFragmentScannerImpl$FragmentContentDriver).next() line: 2778
XMLDocumentScannerImpl.next() line: 606
XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 510
XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line: 848
XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource) line: 777
SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line: 141
SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource) line: 1213
SAXParserImpl$JAXPSAXParser.parse(InputSource) line: 649
SAXParserImpl.parse(InputSource, DefaultHandler) line: 333
XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map<?,?>) line: 175
XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map<?,?>) line: 253
XMIResourceImpl(ResourceImpl).load(InputStream, Map<?,?>) line: 1518
SAXXMIHandler(XMLHandler).getPackageForURI(String) line: 2550
SAXXMIHandler(XMLHandler).getFactoryForPrefix(String) line: 2429
SAXXMIHandler(XMLHandler).createObjectByType(String, String, boolean) line: 1306
SAXXMIHandler(XMLHandler).createTopObject(String, String) line: 1475
SAXXMIHandler(XMLHandler).processElement(String, String, String) line: 1026
SAXXMIHandler(XMIHandler).processElement(String, String, String) line: 81
SAXXMIHandler(XMLHandler).startElement(String, String, String) line: 1008
SAXXMIHandler(XMLHandler).startElement(String, String, String, Attributes) line: 719
SAXXMIHandler(XMIHandler).startElement(String, String, String, Attributes) line: 163
SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName, XMLAttributes, Augmentations) line: 509
SAXParserImpl$JAXPSAXParser(AbstractXMLDocumentParser).emptyElement(QName, XMLAttributes, Augmentations) line: 182
XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanStartElement() line: 1350
XMLDocumentScannerImpl$ContentDriver(XMLDocumentFragmentScannerImpl$FragmentContentDriver).next() line: 2778
XMLDocumentScannerImpl.next() line: 606
XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 510
XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line: 848
XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource) line: 777
SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line: 141
SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource) line: 1213
SAXParserImpl$JAXPSAXParser.parse(InputSource) line: 649
SAXParserImpl.parse(InputSource, DefaultHandler) line: 333
XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map<?,?>) line: 175
XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map<?,?>) line: 253
XMIResourceImpl(ResourceImpl).load(InputStream, Map<?,?>) line: 1518
SAXXMIHandler(XMLHandler).getPackageForURI(String) line: 2550
SAXXMIHandler(XMLHandler).getFactoryForPrefix(String) line: 2429
SAXXMIHandler(XMLHandler).createObjectByType(String, String, boolean) line: 1306
SAXXMIHandler(XMLHandler).createTopObject(String, String) line: 1475
SAXXMIHandler(XMLHandler).processElement(String, String, String) line: 1026
SAXXMIHandler(XMIHandler).processElement(String, String, String) line: 81
SAXXMIHandler(XMLHandler).startElement(String, String, String) line: 1008
SAXXMIHandler(XMLHandler).startElement(String, String, String, Attributes) line: 719
SAXXMIHandler(XMIHandler).startElement(String, String, String, Attributes) line: 163
SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName, XMLAttributes, Augmentations) line: 509
SAXParserImpl$JAXPSAXParser(AbstractXMLDocumentParser).emptyElement(QName, XMLAttributes, Augmentations) line: 182
XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanStartElement() line: 1350
XMLDocumentScannerImpl$ContentDriver(XMLDocumentFragmentScannerImpl$FragmentContentDriver).next() line: 2778
XMLDocumentScannerImpl.next() line: 606
XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: 510
XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line: 848
XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource) line: 777
SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line: 141
SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource) line: 1213
SAXParserImpl$JAXPSAXParser.parse(InputSource) line: 649
SAXParserImpl.parse(InputSource, DefaultHandler) line: 333
XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map<?,?>) line: 175
XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map<?,?>) line: 253
XMIResourceImpl(ResourceImpl).load(InputStream, Map<?,?>) line: 1518
XMIResourceImpl(ResourceImpl).load(Map<?,?>) line: 1297
ResourceSetImpl.demandLoad(Resource) line: 259
ResourceSetImpl.demandLoadHelper(Resource) line: 274
ResourceSetImpl.getResource(URI, boolean) line: 406
CodeGenerator.generate(boolean) line: 122
GeneratorWizard.performFinish() line: 56
WizardDialog.finishPressed() line: 827
WizardDialog.buttonPressed(int) line: 432
Dialog$2.widgetSelected(SelectionEvent) line: 628
TypedListener.handleEvent(Event) line: 248
EventTable.sendEvent(Event) line: 84
Display.sendEvent(EventTable, Event) line: 4166
Button(Widget).sendEvent(Event) line: 1466
Button(Widget).sendEvent(int, Event, boolean) line: 1489
Button(Widget).sendEvent(int, Event) line: 1474
Button(Widget).notifyListeners(int, Event) line: 1279
Display.runDeferredEvents() line: 4012
Display.readAndDispatch() line: 3651
WizardDialog(Window).runEventLoop(Shell) line: 826
WizardDialog(Window).open() line: 802
CodeGenerator.run(IAction) line: 84
WWinPluginAction(PluginAction).runWithEvent(Event) line: 251
WWinPluginAction.runWithEvent(Event) line: 229
PluginActionCoolBarContributionItem(ActionContributionItem).handleWidgetSelection(Event, boolean) line: 584
ActionContributionItem.access$2(ActionContributionItem, Event, boolean) line: 501
ActionContributionItem$6.handleEvent(Event) line: 452
EventTable.sendEvent(Event) line: 84
Display.sendEvent(EventTable, Event) line: 4166
ToolItem(Widget).sendEvent(Event) line: 1466
ToolItem(Widget).sendEvent(int, Event, boolean) line: 1489
ToolItem(Widget).sendEvent(int, Event) line: 1474
ToolItem(Widget).notifyListeners(int, Event) line: 1279
Display.runDeferredEvents() line: 4012
Display.readAndDispatch() line: 3651
PartRenderingEngine$9.run() line: 1113
Realm.runWithDefault(Realm, Runnable) line: 332
PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 997
E4Workbench.createAndRunUI(MApplicationElement) line: 138
Workbench$5.run() line: 610
Realm.runWithDefault(Realm, Runnable) line: 332
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 567
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 150
IDEApplication.start(IApplicationContext) line: 124
EclipseAppHandle.run(Object) line: 196
EclipseAppLauncher.runApplication(Object) line: 110
EclipseAppLauncher.start(Object) line: 79
EclipseStarter.run(Object) line: 354
EclipseStarter.run(String[], Runnable) line: 181
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 606
Main.invokeFramework(String[], URL[]) line: 636
Main.basicRun(String[]) line: 591
Main.run(String[]) line: 1450
Main.main(String[]) line: 1426
|
|
|
Re: Null pointer exception in EStructuralFeatureImpl.getSettingDelegate [message #1191723 is a reply to message #1190606] |
Sun, 17 November 2013 01:57   |
Eclipse User |
|
|
|
Aram,
You'll need to see what's going wrong in
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.computeFeatureKind(EStructuralFeature).
If it'a an EAttribute, its eType must be an EDataType so that method
must compute one of the first two values for the kind
protected void computeFeatureKind(EStructuralFeature feature)
{
EClassifier eClassifier = feature.getEType();
if (eClassifier instanceof EDataType)
{
if (feature.isMany())
{
featuresToKinds.put(feature, INTEGER_DATATYPE_IS_MANY);
}
else
{
featuresToKinds.put(feature, INTEGER_DATATYPE_SINGLE);
}
}
so in
if (kind == XMLHelper.DATATYPE_SINGLE || kind ==
XMLHelper.DATATYPE_IS_MANY)
{
setFeatureValue(object, feature, value, -2);
}
else
{
setValueFromId(object, (EReference)feature, value);
}
it should take the first branch, but apparently in your case it's taken
the second, so you must have an EAttribute whose eType is an EClass (or
null), neither of which are valid. So look at the feature in question,
and determine why it's got the wrong type.
On 16/11/2013 6:54 PM, Aram Hovsepyan wrote:
> Ed,
>
> Thanks for the pointers. I have found the "dodgy" profile and it was
> some MagicDraw customisation profile. I have removed that one, but now
> I have another problem. The error I get is when trying to cast from
> EAttributeImpl to EReference. Here is the stack trace. I've looked
> around for this one and there is one bug report linked to this issue.
> So, is this really an Eclipse bug, or is there another problem with
> MagicDraw export.
> Thanks a lot.
>
> Thread [main] (Suspended (exception ClassCastException))
> SAXXMIHandler(XMLHandler).setAttribValue(EObject, String, String)
> line: 2729
> SAXXMIHandler.handleObjectAttribs(EObject) line: 79
> SAXXMIHandler(XMLHandler).createObjectFromFactory(EFactory,
> String) line: 2200
> SAXXMIHandler(XMLHandler).createObjectByType(String, String,
> boolean) line: 1337
> SAXXMIHandler(XMLHandler).createTopObject(String, String) line: 1475
> SAXXMIHandler(XMLHandler).processElement(String, String, String)
> line: 1026
> SAXXMIHandler(XMIHandler).processElement(String, String, String)
> line: 81
> SAXXMIHandler(XMLHandler).startElement(String, String, String)
> line: 1008
> SAXXMIHandler(XMLHandler).startElement(String, String, String,
> Attributes) line: 719
> SAXXMIHandler(XMIHandler).startElement(String, String, String,
> Attributes) line: 163
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName,
> XMLAttributes, Augmentations) line: 509
> SAXParserImpl$JAXPSAXParser(AbstractXMLDocumentParser).emptyElement(QName,
> XMLAttributes, Augmentations) line: 182
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanStartElement()
> line: 1350
> XMLDocumentScannerImpl$ContentDriver(XMLDocumentFragmentScannerImpl$FragmentContentDriver).next()
> line: 2778
> XMLDocumentScannerImpl.next() line: 606
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean)
> line: 510
> XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line:
> 848
> XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource)
> line: 777
> SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line:
> 141
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource)
> line: 1213
> SAXParserImpl$JAXPSAXParser.parse(InputSource) line: 649
> SAXParserImpl.parse(InputSource, DefaultHandler) line: 333
> XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map<?,?>)
> line: 175
> XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map<?,?>)
> line: 253
> XMIResourceImpl(ResourceImpl).load(InputStream, Map<?,?>) line: 1518
> SAXXMIHandler(XMLHandler).getPackageForURI(String) line: 2550
> SAXXMIHandler(XMLHandler).getFactoryForPrefix(String) line: 2429
> SAXXMIHandler(XMLHandler).createObjectByType(String, String,
> boolean) line: 1306
> SAXXMIHandler(XMLHandler).createTopObject(String, String) line: 1475
> SAXXMIHandler(XMLHandler).processElement(String, String, String)
> line: 1026
> SAXXMIHandler(XMIHandler).processElement(String, String, String)
> line: 81
> SAXXMIHandler(XMLHandler).startElement(String, String, String)
> line: 1008
> SAXXMIHandler(XMLHandler).startElement(String, String, String,
> Attributes) line: 719
> SAXXMIHandler(XMIHandler).startElement(String, String, String,
> Attributes) line: 163
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName,
> XMLAttributes, Augmentations) line: 509
> SAXParserImpl$JAXPSAXParser(AbstractXMLDocumentParser).emptyElement(QName,
> XMLAttributes, Augmentations) line: 182
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanStartElement()
> line: 1350
> XMLDocumentScannerImpl$ContentDriver(XMLDocumentFragmentScannerImpl$FragmentContentDriver).next()
> line: 2778
> XMLDocumentScannerImpl.next() line: 606
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean)
> line: 510
> XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line:
> 848
> XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource)
> line: 777
> SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line:
> 141
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource)
> line: 1213
> SAXParserImpl$JAXPSAXParser.parse(InputSource) line: 649
> SAXParserImpl.parse(InputSource, DefaultHandler) line: 333
> XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map<?,?>)
> line: 175
> XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map<?,?>)
> line: 253
> XMIResourceImpl(ResourceImpl).load(InputStream, Map<?,?>) line: 1518
> SAXXMIHandler(XMLHandler).getPackageForURI(String) line: 2550
> SAXXMIHandler(XMLHandler).getFactoryForPrefix(String) line: 2429
> SAXXMIHandler(XMLHandler).createObjectByType(String, String,
> boolean) line: 1306
> SAXXMIHandler(XMLHandler).createTopObject(String, String) line: 1475
> SAXXMIHandler(XMLHandler).processElement(String, String, String)
> line: 1026
> SAXXMIHandler(XMIHandler).processElement(String, String, String)
> line: 81
> SAXXMIHandler(XMLHandler).startElement(String, String, String)
> line: 1008
> SAXXMIHandler(XMLHandler).startElement(String, String, String,
> Attributes) line: 719
> SAXXMIHandler(XMIHandler).startElement(String, String, String,
> Attributes) line: 163
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName,
> XMLAttributes, Augmentations) line: 509
> SAXParserImpl$JAXPSAXParser(AbstractXMLDocumentParser).emptyElement(QName,
> XMLAttributes, Augmentations) line: 182
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanStartElement()
> line: 1350
> XMLDocumentScannerImpl$ContentDriver(XMLDocumentFragmentScannerImpl$FragmentContentDriver).next()
> line: 2778
> XMLDocumentScannerImpl.next() line: 606
> XMLDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean)
> line: 510
> XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line:
> 848
> XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource)
> line: 777
> SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line:
> 141
> SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource)
> line: 1213
> SAXParserImpl$JAXPSAXParser.parse(InputSource) line: 649
> SAXParserImpl.parse(InputSource, DefaultHandler) line: 333
> XMILoadImpl(XMLLoadImpl).load(XMLResource, InputStream, Map<?,?>)
> line: 175
> XMIResourceImpl(XMLResourceImpl).doLoad(InputStream, Map<?,?>)
> line: 253
> XMIResourceImpl(ResourceImpl).load(InputStream, Map<?,?>) line: 1518
> XMIResourceImpl(ResourceImpl).load(Map<?,?>) line: 1297
> ResourceSetImpl.demandLoad(Resource) line: 259
> ResourceSetImpl.demandLoadHelper(Resource) line: 274
> ResourceSetImpl.getResource(URI, boolean) line: 406
> CodeGenerator.generate(boolean) line: 122
> GeneratorWizard.performFinish() line: 56
> WizardDialog.finishPressed() line: 827
> WizardDialog.buttonPressed(int) line: 432
> Dialog$2.widgetSelected(SelectionEvent) line: 628
> TypedListener.handleEvent(Event) line: 248
> EventTable.sendEvent(Event) line: 84
> Display.sendEvent(EventTable, Event) line: 4166
> Button(Widget).sendEvent(Event) line: 1466
> Button(Widget).sendEvent(int, Event, boolean) line: 1489
> Button(Widget).sendEvent(int, Event) line: 1474
> Button(Widget).notifyListeners(int, Event) line: 1279
> Display.runDeferredEvents() line: 4012
> Display.readAndDispatch() line: 3651
> WizardDialog(Window).runEventLoop(Shell) line: 826
> WizardDialog(Window).open() line: 802
> CodeGenerator.run(IAction) line: 84
> WWinPluginAction(PluginAction).runWithEvent(Event) line: 251
> WWinPluginAction.runWithEvent(Event) line: 229
> PluginActionCoolBarContributionItem(ActionContributionItem).handleWidgetSelection(Event,
> boolean) line: 584
> ActionContributionItem.access$2(ActionContributionItem, Event,
> boolean) line: 501
> ActionContributionItem$6.handleEvent(Event) line: 452
> EventTable.sendEvent(Event) line: 84
> Display.sendEvent(EventTable, Event) line: 4166
> ToolItem(Widget).sendEvent(Event) line: 1466
> ToolItem(Widget).sendEvent(int, Event, boolean) line: 1489
> ToolItem(Widget).sendEvent(int, Event) line: 1474
> ToolItem(Widget).notifyListeners(int, Event) line: 1279
> Display.runDeferredEvents() line: 4012
> Display.readAndDispatch() line: 3651
> PartRenderingEngine$9.run() line: 1113
> Realm.runWithDefault(Realm, Runnable) line: 332
> PartRenderingEngine.run(MApplicationElement, IEclipseContext)
> line: 997
> E4Workbench.createAndRunUI(MApplicationElement) line: 138
> Workbench$5.run() line: 610
> Realm.runWithDefault(Realm, Runnable) line: 332
> Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 567
> PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 150
> IDEApplication.start(IApplicationContext) line: 124
> EclipseAppHandle.run(Object) line: 196
> EclipseAppLauncher.runApplication(Object) line: 110
> EclipseAppLauncher.start(Object) line: 79
> EclipseStarter.run(Object) line: 354
> EclipseStarter.run(String[], Runnable) line: 181
> NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
> not available [native method]
> NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
> DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
> Method.invoke(Object, Object...) line: 606
> Main.invokeFramework(String[], URL[]) line: 636
> Main.basicRun(String[]) line: 591
> Main.run(String[]) line: 1450
> Main.main(String[]) line: 1426
>
|
|
|
Re: Null pointer exception in EStructuralFeatureImpl.getSettingDelegate [message #1195005 is a reply to message #1191723] |
Mon, 18 November 2013 15:11  |
Eclipse User |
|
|
|
Hi Ed,
I can't figure it out. I now somehow got rid of this error but got another NPE at another spot. I have managed to somehow get rid of MagicDraw problematic profiles (although the tool complained numerous times that I shouldn't do that) and now everything works. Bottom line - UML Metamodel is in theory sufficient to create any MagicDraw profile by yourself. So the post can be closed, thanks for the valuable advices.
Cheers.
|
|
|
Goto Forum:
Current Time: Thu Jun 12 09:17:18 EDT 2025
Powered by FUDForum. Page generated in 0.07582 seconds
|