被這個問題折磨了很久......html
開發環境:win7/Eclipse/maven 2.2.1java
問題描述:在Eclipse中使用Maven install命令打包,在發佈時提示:An internal error occurred during: "Updating status for Tomcat v6.0 Server at localhost..."web
進入workspace/.metadata/.log 查看日誌,顯示出錯日誌以下:eclipse
!ENTRY org.eclipse.core.jobs 4 2 2012-08-26 07:17:12.186 !MESSAGE An internal error occurred during: "Updating status for Tomcat v6.0 Server at localhost...". !STACK 0 java.lang.NullPointerException at org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities.getDefaultProjectArchiveName(VirtualReferenceUtilities.java:81) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getJavaClasspathReferences(J2EEModuleVirtualComponent.java:338) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getNonManifestRefs(J2EEModuleVirtualComponent.java:242) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:166) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:214) at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:207) at org.eclipse.jst.common.internal.modulecore.SingleRootUtil.hasConsumableReferences(SingleRootUtil.java:217) at org.eclipse.jst.common.internal.modulecore.SingleRootUtil.validateSingleRoot(SingleRootUtil.java:165) at org.eclipse.jst.common.internal.modulecore.SingleRootUtil.isSingleRoot(SingleRootUtil.java:93) at org.eclipse.jst.common.internal.modulecore.SingleRootExportParticipant.canOptimize(SingleRootExportParticipant.java:88) at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.canOptimize(FlatVirtualComponent.java:136) at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.cacheResources(FlatVirtualComponent.java:118) at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.fetchResources(FlatVirtualComponent.java:101) at org.eclipse.wst.web.internal.deployables.FlatComponentDeployable.members(FlatComponentDeployable.java:227) at org.eclipse.wst.server.core.internal.ModulePublishInfo.hasDelta(ModulePublishInfo.java:415) at org.eclipse.wst.server.core.internal.ServerPublishInfo.hasDelta(ServerPublishInfo.java:440) at org.eclipse.wst.server.core.internal.Server.hasPublishedResourceDelta(Server.java:1579) at org.eclipse.wst.server.core.internal.Server$ResourceChangeJob$1.visit(Server.java:217) at org.eclipse.wst.server.core.internal.Server.visitModule(Server.java:2991) at org.eclipse.wst.server.core.internal.Server.visit(Server.java:2975) at org.eclipse.wst.server.core.internal.Server$ResourceChangeJob.run(Server.java:228) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
幾番波折,查找到 Eclipse 官方的 Bug 360256,錯誤信息比較一致,參見 https://bugs.eclipse.org/bugs/show_bug.cgi?id=360256 maven
不過 Eclipse 官方拒絕了這個 Bug ,回覆爲:「 Please report m2e-wtp integration issues to https://issues.sonatype.org/browse/MECLIPSEWTP」,從這兒卻是看出,有多是 m2e-wtp 的問題;fetch
檢查 Eclipse 安裝的插件,發現只有 m2e 的插件,沒有 m2e-wtp 的,從新安裝 m2e-wtp ( http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/)問題解決。 spa