Error NPE DefaultReportingConverter when updating project configuration in a maven project
See original GitHub issueHi, I’ve been using this extension for a year now and I’ve recently encountered an issue with it that I can’t seem to find a solution for. I get and NPE DefaultReportingConverter when updating the project configuration of any exisiting or new maven project I create. I updated my current version of maven to 3.6.2 as I found online this could be the issue https://issues.apache.org/jira/browse/MNG-6636. However, the standalone maven compile command successfully build the project.
Here’s my settings.json file:
{
"java.configuration.checkProjectSettingsExclusions": false,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"java.home": "C:\\Program Files\\RedHat\\java-1.8.0-openjdk-1.8.0.161-1",
"java.import.maven.enabled": true,
"java.maven.downloadSources": true,
"maven.pomfile.autoUpdateEffectivePOM": true
}
Environment
- Operating System: Windows server 2012 R2 Standard
- JDK version: 1.7.141
- Visual Studio Code version: 1.39.2
- Java extension version: 0.51.0
- Maven version: 3.6.2
Steps To Reproduce
- Update project configuration on a pom.xml file
A brand new maven project is enough to reproduce the problem.
Here’s the error log:
[Error - 2:15:10 PM] Oct 16, 2019 2:15:10 PM Problems occurred when invoking code from plug-in: “org.eclipse.core.resources”. null java.lang.NullPointerException at org.apache.maven.model.plugin.DefaultReportingConverter.convert(DefaultReportingConverter.java:243) at org.apache.maven.model.plugin.DefaultReportingConverter.convert(DefaultReportingConverter.java:213) at org.apache.maven.model.plugin.DefaultReportingConverter.convertReporting(DefaultReportingConverter.java:140) at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:479) at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:432) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:616) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:385) at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProjects(MavenImpl.java:659) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$3(ProjectRegistryManager.java:738) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.execute(ProjectRegistryManager.java:1026) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.readMavenProjectFacades(ProjectRegistryManager.java:736) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:432) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:365) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:312) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:155) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:90) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:87) at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:201) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
[Error - 2:15:10 PM] Oct 16, 2019 2:15:10 PM Problems occurred when invoking code from plug-in: “org.eclipse.core.resources”. null java.lang.NullPointerException at org.apache.maven.model.plugin.DefaultReportingConverter.convert(DefaultReportingConverter.java:243) at org.apache.maven.model.plugin.DefaultReportingConverter.convert(DefaultReportingConverter.java:213) at org.apache.maven.model.plugin.DefaultReportingConverter.convertReporting(DefaultReportingConverter.java:140) at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:479) at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:432) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:616) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:385) at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProjects(MavenImpl.java:659) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$3(ProjectRegistryManager.java:738) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.execute(ProjectRegistryManager.java:1026) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.readMavenProjectFacades(ProjectRegistryManager.java:736) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:432) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:365) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:312) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:155) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:90) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:87) at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:201) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
[Error - 2:15:10 PM] Oct 16, 2019 2:15:10 PM Errors occurred during the build.
Current Result
The java language server starts without loading maven dependencies
Expected Result
The java language server should load the maven dependencies
Additional Informations
Here’s a pom.xml example of a project that fails: *Note that on line 2, “project” is underlined red and shows this error: Error while downloading ‘http://maven.apache.org/maven-v4_0_0.xsd’ to C:\Users{user}.lsp4xml\cache\http\maven.apache.org\maven-v4_0_0.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.whatever.courtage.sfl</groupId>
<artifactId>sfl-contact</artifactId>
<version>1.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Whatever Portlet :: sfl-contact</name>
<parent>
<groupId>com.whatever.services-communs.portail.dependances</groupId>
<artifactId>fwd-infra-portail-parent</artifactId>
<version>2.4.2</version>
</parent>
<modules>
<module>portlet</module>
<module>soapservice</module>
</modules>
<scm>
<tag>v-1.0.0</tag>
</scm>
</project>
Issue Analytics
- State:
- Created 4 years ago
- Comments:24 (6 by maintainers)
Top GitHub Comments
right, 3.6.2 is not in the latest m2e release. I’ll look into consuming new builds tomorrow
Humm… maven 3.6.2 was released on 2019-08-27 (https://maven.apache.org/docs/history.html) and m2e 1.13 was on 2019-09-18 (https://projects.eclipse.org/projects/technology.m2e). Pretty sure you don’t have the latest maven if you use any m2e released before August 27.