Solution to the schema load failure of EMF

Source: Internet
Author: User

In EMF, you can use XML schema to define the model and then convert it to the genmodel model. However, after I load the fourth step of the genmodel wizard, an nullpointerexception is generated as follows, leading to the inability to continue:

Java. Lang. nullpointerexception
At org. Apache. Crimson. Tree. elementnode2.getattributenodens (elementnode2.java: 432 )
At org. Apache. Crimson. Tree. elementnode2.hasattributens (elementnode2.java: 388 )
At org. Eclipse. XSD. ecore. xsdecorebuilder. getecoreattribute (xsdecorebuilder. Java: 2336 )
At org. Eclipse. XSD. ecore. xsdecorebuilder. getecoreattribute (xsdecorebuilder. Java: 2329 )
At org. Eclipse. XSD. ecore. xsdecorebuilder. getestructuralfeature (xsdecorebuilder. Java: 2004 )
At org. Eclipse. XSD. ecore. xsdecorebuilder. Generate (xsdecorebuilder. Java: 2117 )
At org. Eclipse. XSD. ecore. xsdecorebuilder. Generate (xsdecorebuilder. Java: 2067 )
At org. Eclipse. XSD. ecore. Importer. xsdimporter. docomputeepackages (xsdimporter. Java: 123 )
At org. Eclipse. EMF. Importer. modelimporter. computeepackages (modelimporter. Java: 664 )
At org. Eclipse. EMF. Importer. UI. contribution. Base. modeldetailpage. refreshmodel (modeldetailpage. Java: 488 )
At org. Eclipse. EMF. Importer. UI. contribution. Base. modeldetailpage $ 2 . Execute (modeldetailpage. Java: 434 )
At org. Eclipse. UI. Actions. workspacemodifyoperation $ 1 . Run (workspacemodifyoperation. Java: 98 )
At org. Eclipse. Core. Internal. Resources. workspace. Run (workspace. Java: 1719 )
At org. Eclipse. UI. Actions. workspacemodifyoperation. Run (workspacemodifyoperation. Java: 110 )
At org. Eclipse. jface. Operation. modalcontext. runincurrentthread (modalcontext. Java: 346 )
At org. Eclipse. jface. Operation. modalcontext. Run (modalcontext. Java: 291 )
At org. Eclipse. jface. Wizard. wizarddialog. Run (wizarddialog. Java: 830 )
At org. Eclipse. EMF. Importer. UI. contribution. Base. modeldetailpage. refreshmodel (modeldetailpage. Java: 457 )
At org. Eclipse. EMF. Importer. UI. contribution. Base. modeldetailpage. dohandleevent (modeldetailpage. Java: 241 )
At org. Eclipse. XSD. ecore. Importer. UI. xsddetailpage. dohandleevent (xsddetailpage. Java: 91 )
At org. Eclipse. EMF. Importer. UI. contribution. Base. modelimporterpage. handleevent (modelimporterpage. Java: 106 )
At org. Eclipse. SWT. Widgets. eventtable. sendevent (eventtable. Java: 66 )
At org. Eclipse. SWT. Widgets. widget. sendevent (widget. Java: 1021 )
At org. Eclipse. SWT. Widgets. display. rundeferredevents (display. Java: 2867 )
At org. Eclipse. SWT. Widgets. display. readanddispatch (display. Java: 2572 )
At org. Eclipse. jface. Window. Window. runeventloop (window. Java: 809 )
At org. Eclipse. jface. Window. Window. Open (window. Java: 787 )
At org. Eclipse. UI. Actions. newwizardaction. Run (newwizardaction. Java: 181 )
At org. Eclipse. UI. Actions. newwizarddropdownaction. Run (newwizarddropdownaction. Java: 174 )
At org. Eclipse. jface. action. Action. runwithevent (action. Java: 996 )
At org. Eclipse. jface. Action. actioncontributionitem. handlewidgetselection (actioncontributionitem. Java: 538 )
At org. Eclipse. jface. Action. actioncontributionitem. Access $ 2 (Actioncontributionitem. Java: 488 )
At org. Eclipse. jface. Action. actioncontributionitem $ 6 . Handleevent (actioncontributionitem. Java: 441 )
At org. Eclipse. SWT. Widgets. eventtable. sendevent (eventtable. Java: 66 )
At org. Eclipse. SWT. Widgets. widget. sendevent (widget. Java: 1021 )
At org. Eclipse. SWT. Widgets. display. rundeferredevents (display. Java: 2867 )
At org. Eclipse. SWT. Widgets. display. readanddispatch (display. Java: 2572 )
At org. Eclipse. UI. Internal. workbench. runeventloop (workbench. Java: 1699 )
At org. Eclipse. UI. Internal. workbench. runui (workbench. Java: 1663 )
At org. Eclipse. UI. Internal. workbench. createandrunworkbench (workbench. Java: 367 )
At org. Eclipse. UI. platformui. createandrunworkbench (platformui. Java: 143 )
At org. Eclipse. UI. Internal. Ide. ideapplication. Run (ideapplication. Java: 103 )
At org. Eclipse. Core. Internal. runtime. platformactivator $ 1 . Run (platformactivator. Java: 226 )
At org. Eclipse. Core. runtime. adaptor. eclipsestarter. Run (eclipsestarter. Java: 376 )
At org. Eclipse. Core. runtime. adaptor. eclipsestarter. Run (eclipsestarter. Java: 163 )
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39 )
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25 )
At java. Lang. Reflect. method. Invoke (method. Java: 324 )
At org. Eclipse. Core. launcher. Main. invokeframework (main. Java: 334 )
At org. Eclipse. Core. launcher. Main. basicrun (main. Java: 278 )
At org. Eclipse. Core. launcher. Main. Run (main. Java: 973 )
At org. Eclipse. Core. launcher. Main. Main (main. Java: 948 )

This is caused by a bug in Sun jdk1.4. The solution is to use third-party XML
Parser, for example, xerces-J. Download xerces-J and decompress it. Then, add "-vmargs" to the startup parameters of Eclipse.
-Djava. endorsed. dirs = <path-to-your-xerces-jars-Folder>.

EMF instructions on this issue: XSD model loading: crimson Dom bug, workaround & download

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.