MyEclipse Server view报错解决方法
方法/步骤
-
启动MyEclipse,弹出一个框,报错。
--------------------------------------------------------------------------------
Errors occurred during the build.
Errors running builder 'DeploymentBuilder' on project 'SeNT-DL'.
java.lang.NullPointerException
-
Server view报错:
--------------------------------------------------------------------------------
Could not create the view: An unexpected exception was thrown.
-
Server view报错:
--------------------------------------------------------------------------------
java.lang.NullPointerException
at com.genuitec.eclipse.ast.deploy.core.Deployment.<init>(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.ModuleDeployment.<init>(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.WebDeployment.<init>(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.Deployment.create(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentManager.loadFromPreferences(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentManager.init(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentManager.<init>(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentManager.getDefault(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.ui.ServerTreeViewer$ServerTreeContentProvider.inputChanged(Unknown Source)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:276)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690)
at com.genuitec.eclipse.ast.deploy.core.ui.ServerTreeViewer.<init>(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.ui.ServerView.createPartControl(Unknown Source)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:375)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.Perspective.showFastView(Perspective.java:2171)
at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1939)
at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1952)
at org.eclipse.ui.internal.Perspective.toggleFastView(Perspective.java:2367)
at org.eclipse.ui.internal.WorkbenchPage.toggleFastView(WorkbenchPage.java:3972)
at org.eclipse.ui.internal.ShowFastViewContribution.showView(ShowFastViewContribution.java:157)
at org.eclipse.ui.internal.ShowFastViewContribution.access$1(ShowFastViewContribution.java:155)
at org.eclipse.ui.internal.ShowFastViewContribution$3.widgetSelected(ShowFastViewContribution.java:138)
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:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)
-
Server视图显示的是项目部署在Server的情况,每个工作空间都有个性化配置。找到工作空间的Server项目部署配置文件。
--------------------------------------------------------------------------------
目录是$工作空间\.metadata\.plugins\org.eclipse.core.runtime\.settings\com.genuitec.eclipse.ast.deploy.core.prefs
-
根据工作空间的Server项目部署配置文件可以看出,Server部署了两个项目,分别是SeNT-DL,SeNT-b11M
--------------------------------------------------------------------------------
eclipse.preferences.version=1
tomcat7Server.SeNT-DL.IEARProjectName=
tomcat7Server.SeNT-DL.altContextRoot=
tomcat7Server.SeNT-DL.contextRoot=/SeNT-DL
tomcat7Server.SeNT-DL.deployIsOverProject=false
tomcat7Server.SeNT-DL.deploymentPath=F\:\\apache-tomcat-7.0.55\\webapps\\SeNT-DL
tomcat7Server.SeNT-DL.isDeployed=true
tomcat7Server.SeNT-DL.isExploded=true
tomcat7Server.SeNT-DL.isUptoDate=true
tomcat7Server.SeNT-DL.noFileCopy=false
tomcat7Server.SeNT-DL.shouldBackup=false
tomcat7Server.SeNT-DL.shouldOverwrite=false
tomcat7Server.SeNT-DL.type=WebDeployment
tomcat7Server.SeNT-b11M.IEARProjectName=
tomcat7Server.SeNT-b11M.altContextRoot=
tomcat7Server.SeNT-b11M.contextRoot=/SeNT-b11M
tomcat7Server.SeNT-b11M.deployIsOverProject=false
tomcat7Server.SeNT-b11M.deploymentPath=F\:\\apache-tomcat-7.0.55\\webapps\\SeNT-b11M
tomcat7Server.SeNT-b11M.isDeployed=true
tomcat7Server.SeNT-b11M.isExploded=true
tomcat7Server.SeNT-b11M.isUptoDate=true
tomcat7Server.SeNT-b11M.noFileCopy=false
tomcat7Server.SeNT-b11M.shouldBackup=false
tomcat7Server.SeNT-b11M.shouldOverwrite=false
tomcat7Server.SeNT-b11M.type=WebDeployment
-
实际上,Server只部署了一个项目SeNT-DL,另外一个项目SeNT-b11M被删除了。
-
另外一个项目SeNT-b11M被删除了,删除的方式是进入tomcat的webapps,直接删除。没有通知MyEclipse,导致MyEclipse的工作空间的Server项目部署配置文件没有做更新,依旧配置Server部署了两个项目,分别是SeNT-DL,SeNT-b11M。
-
解决方法一:更新MyEclipse的工作空间的Server项目部署配置文件com.genuitec.eclipse.ast.deploy.core.prefs,根据实际情况,删除已经不存在于Server的项目配置。把以下高亮部分配置删除。
-
解决方法二:删除tomcat的webapps的所有项目,删除文件com.genuitec.eclipse.ast.deploy.core.prefs。这种方式相当于清空部署在tomcat的所有项目,清空MyEclipse的工作空间的Server项目部署配置文件。(本人使用的就是这一种方法 ,直接删除)
-
为了避免此类问题再次出现,想要删除部署在tomcat的项目时,不要进入tomcat的webapps,直接删除,而是在server view视图做删除。在server view视图做删除项目时,MyEclipse会更新工作空间的Server项目部署配置文件。