Eclipse在Maven更新期间抛出NullPointerException

我一直在解决内部Eclipse错误两天。我正在运行Eclipse的最新Spring Tool

Suite版本,并且试图导入现有Maven项目的集合。每当执行此操作时,Eclipse都会引发NullPointerException,但“错误日志”视图中没有可用的堆栈跟踪。如果我指示Eclipse更新Maven项目(“

Maven”>“更新项目”),则会再次获得NullPointerException。这次,“错误日志”视图报告以下堆栈跟踪:

java.lang.NullPointerException

at org.eclipse.wst.common.componentcore.internal.resources.VirtualResource.getProjectRelativePaths(VirtualResource.java:119)

at org.eclipse.wst.common.componentcore.internal.resources.VirtualFile.getUnderlyingFiles(VirtualFile.java:104)

at org.eclipse.wst.common.componentcore.internal.resources.VirtualFile.getUnderlyingResources(VirtualFile.java:93)

at org.eclipse.wst.common.componentcore.internal.resources.VirtualResource.exists(VirtualResource.java:88)

at org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities.getNonBinaryComponentManifest(ManifestUtilities.java:124)

at org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities.getManifest(ManifestUtilities.java:81)

at org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities.getManifestClasspath(ManifestUtilities.java:147)

at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getManifestClasspath(J2EEModuleVirtualComponent.java:248)

at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.calculateManifestReferences(J2EEModuleVirtualComponent.java:368)

at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.cacheManifestReferences(J2EEModuleVirtualComponent.java:360)

at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:176)

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.m2e.wtp.WebProjectConfiguratorDelegate.configureClasspath(WebProjectConfiguratorDelegate.java:386)

at org.eclipse.m2e.wtp.WTPProjectConfigurator.configureClasspath(WTPProjectConfigurator.java:107)

at org.eclipse.m2e.jdt.internal.DefaultClasspathManagerDelegate.populateClasspath(DefaultClasspathManagerDelegate.java:61)

at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:253)

at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:363)

at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:343)

at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:371)

at org.eclipse.m2e.jdt.internal.BuildPathManager.updateClasspath(BuildPathManager.java:191)

at org.eclipse.m2e.jdt.internal.BuildPathManager.mavenProjectChanged(BuildPathManager.java:180)

at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:746)

at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:865)

at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:289)

at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:369)

at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:316)

at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:1)

at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:161)

at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:137)

at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:89)

at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1301)

at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:313)

at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:77)

at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

这是我尝试过的:

  • 我吹走了我的工作区并创建了一个新的工作区。多次。
  • 我已经吹走了我的Maven存储库,以便可以重新创建它。
  • 我已经重新安装了Spring Tool Suite。
  • 我尝试让Eclipse更新Maven信息库。
  • 我已经在本地SVN存储库中检查了合并冲突。(没有;这是新创建的来自树干的全新分支。)
  • 我已经检查了Eclipse中的Synchronize视图,看它是否有任何区别。(Eclipse远远不能识别任何可用于同步的项目。)
  • 我已经在Google上搜索了VirtualResource.getProjectRelativePaths()中发生的NullPointerExceptions。我在其他非常相似的地方找到了NullPointerExceptions,并且为它们尝试了一些建议,但都无济于事。

我对这个问题不知所措。Obi-Wan Kenobi,请帮助我,您是我唯一的希望。

回答:

正如echinelli指出的那样,这确实是Eclipse(或STS)错误,但是安装最新版本不是解决办法,因为我已经安装了该版本。我已经基于Eclipse

4.x安装了STS;当我卸载它并转到3.x版本时,问题消失了。

以上是 Eclipse在Maven更新期间抛出NullPointerException 的全部内容, 来源链接: utcz.com/qa/400219.html

回到顶部