打开struts2.xml文件时提示 Could not open the editor: An unexpected exception解决方案
提示错误信息:Could not open the editor: An unexpected exception was thrown.
view source
print?
01 | java.lang.NullPointerException |
02 | at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.processAction(StrutsConfigDiagram.java:574) |
03 | at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.synchronizeDiagram(StrutsConfigDiagram.java:479) |
04 | at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.differedSynchronize(StrutsConfigDiagram.java:120) |
05 | at com.genuitec.eclipse.struts.editor.multipage.StrutsConfigEditor.createPages(StrutsConfigEditor.java:296) |
06 | at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357) |
07 | at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662) |
08 | at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462) |
09 | at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) |
10 | at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313) |
11 | at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180) |
12 | at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270) |
13 | at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) |
14 | at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473) |
15 | at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256) |
16 | at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209) |
17 | at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608) |
18 | at org.eclipse.ui.internal.PartStack.add(PartStack.java:499) |
19 | at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) |
20 | at org.eclipse.ui.internal.PartStack.add(PartStack.java:485) |
21 | at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)...... |
解决方法:关闭MyEclipse,打开项目,找到当前工程的src目录(和struts.xml同级目录),会发现有一个文件,名字为“.struts.mex”。删除这个文件,启动MyEclipse,然后双击,或者右键,选择用“MyEclipse Struts Config Editor”打开struts.xml文件