当前位置: 首页 > 知识库问答 >
问题:

Eclipse在Maven更新期间抛出NullPointerException

潘坚白
2023-03-14

我已经和内部日食错误斗争了两天。我正在运行最新的Eclipse Spring Tool Suite版本,并试图导入现有Maven项目的集合。每当我这样做时,Eclipse都会抛出一个NullPointerException,但是错误日志视图中没有可用的堆栈跟踪。如果我指示Eclipse更新Maven项目(Maven>update project),我将再次获得一个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)
    null

共有1个答案

韩羽
2023-03-14

这就是我修复它的方法

  1. 从工作区中删除项目
  2. 删除.classpath.project.settings文件夹
  3. 重新导入项目
 类似资料:
  • 问题内容: 我一直在解决内部Eclipse错误两天。我正在运行Eclipse的最新Spring Tool Suite版本,并且试图导入现有Maven项目的集合。每当执行此操作时,Eclipse都会引发NullPointerException,但“错误日志”视图中没有可用的堆栈跟踪。如果我指示Eclipse更新Maven项目(“ Maven”>“更新项目”),则会再次获得NullPointerExc

  • 更新Maven项目时获取以下内部错误消息(右键单击Project- 错误消息基本上指向eclipse中的IBM插件 请在下面找到日志: 可能是什么问题?

  • 在eclipse eclipse Java EE IDE下为Web开发人员更新Maven项目时,我遇到了这个错误。(版本:Kepler Service Release 2)在“更新Maven项目”过程中出现内部错误。路径必须包括项目和资源名称:/MyProjectName Thanks

  • 我正在使用安装了m2e WTP插件的Eclipse Juno(试用过的SR1和SR2)。(我也用m2e插件进行了同样的尝试),得到了以下结果: 在“导入Maven项目”过程中发生内部错误。org/eclipse/m2e/wtp/wtpprojectsutil 当我尝试导入一个项目时,以及当我尝试运行mvn更新时,都会发生这种情况。下面是错误的图像: 更新下面是Web项目的POM文件

  • 添加对pom.xml的依赖项并通过进行更新,我得到了这个错误(请参见下面的.log) !条目org.eclipse.core.jobs 4 2 201 2-08-22 10:04:31.078!消息:“更新Maven Project”期间发生内部错误。!Stack 0 java.lang.noClassDeffounderror:org/apache/maven/plugin/war/util/m

  • 我是Maven开发的初学者,需要我们的帮助来解决这个问题。我可以看到, 只有下面的罐子可用 我也得到下面的错误在 生成过程中发生错误。在项目“cim”上运行生成器“Maven Project builder”时出错。无法计算生成计划:插件组织。阿帕奇。专家plugins:maven resources plugin:2.6或其依赖项之一无法解析:无法读取组织的工件描述符。阿帕奇。专家插件:mave