Could not open the editor: An unexpected exception was thrown 错误

出现错误如下:

 

提示错误信息:Could not open the editor: An unexpected exception was thrown. 

java.lang.NullPointerException 

at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.processAction(StrutsConfigDiagram.java:574) 

at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.synchronizeDiagram(StrutsConfigDiagram.java:479) 

at com.genuitec.eclipse.struts.editor.modeler.model.StrutsConfigDiagram.differedSynchronize(StrutsConfigDiagram.java:120) 

at com.genuitec.eclipse.struts.editor.multipage.StrutsConfigEditor.createPages(StrutsConfigEditor.java:296)

at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357) 

at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662) 

at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462) 

at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) 

at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313) 

at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180) 

at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)

at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) 

at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473) 

at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256) 

at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209) 

at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1608) 

at org.eclipse.ui.internal.PartStack.add(PartStack.java:499) 

at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) 

at org.eclipse.ui.internal.PartStack.add(PartStack.java:485) 

at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)......

 

 

出现这个异常好像是跟打开struts配置文件的插件有关,它每次操作完xml后,好像会生成一个同名的.mex的文件,一般报这个错误就是跟这个文件有关,我们用cvs或者svn提交的时候,就会看到这个文件也会提示提交。

 

这边就有两种解决方案,第一种,选中要打开的xml,右键--> open with -->myeclipse xml editor;第二种,关闭myeclipse,打开项目的物理目录,找到与xml同名的.mex文件,删除掉,启动MyEclipse,然后双击,或者右键,选择用“MyEclipse Struts Config Editor”打开struts-config.xml文件,会弹出一个窗口,说找不到文件“.struts-config.mex”,问是否创建,点击“OK”按钮。

你可能感兴趣的:(Could not open the editor: An unexpected exception was thrown 错误)