-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error NPE DefaultReportingConverter when updating project configuration in a maven project #1103
Comments
I can't reproduce. Can you attach the effective pom of a project that fails? |
Thanks for the reply, I've added a pom file in the issue description under additionnal informations. Everything builds fine if I do "mvn install" though. |
@zeen1x you can try the following property:
<YOUR_USERNAME> is your Windows username. |
@snjeza Hi, I don't have a directory named .lsp4xml under %userprofile% |
VS Code XML extension will create it. |
@snjeza I manually created the file at C:\Users{user}.lsp4xml\cache\http\maven.apache.org\maven-v4_0_0.xsd and now the underlined red error is gone. What could cause it to not be able to download this file 'http://maven.apache.org/maven-v4_0_0.xsd' ? I retried for an update project configuration and still have the NPE so it might not be related? |
It is a bug in https://github.com/redhat-developer/vscode-xml
Could you update to JDK 8? |
vscode is indeed using jdk 1.8 since it's the oldest supported. However, my JAVA_HOME environment variable is set to version 1.7.141 And to answer your question, I cannot update to JDK 8 because the server using this project is running JRE 7. |
You can try the following property:
|
@snjeza Humm, I'm not sure what your are asking me to do at this point. This is exactly whats in my settings.json. I have a different setup who is running a newer version "java.home": "C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.212-3" and still has issues with this file 'http://maven.apache.org/maven-v4_0_0.xsd' download |
@snjeza I think I see what you did. The copy paste I made removed the double backslash "\\". If this is what you were asking me to add then this is not the source of the problem. |
Is there C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.212-3\bin\javac.exe ? |
Yes, it has the javac executable. |
It did work on the past but something happened. I have an old workspace storage that I can work with but any new dependencies won't download because of this error. |
Could you try to disable the XML extension? |
I disabled the XML extension and still have the NPE |
@fbricon Have you ever seen anything like this before? |
nope, only saw references in upstream Maven jira. Did you try to clean the Java language server working directory (see in command palette) |
Yes I tried. I did a backup of my workspace storage before doing this so I can still work on old projects with partial maven dependencies loaded. However, if I clean the java language server working directory, it will clean the workspace storage and I will lose the dependencies since it fails to load them. |
I found out by installing the newest version of eclipse that the NPE error was also occuring. In Window >> Preferences >> Maven >> Installations of eclipse I saw it was using version 3.6.1 of maven and that could explain the error I was having. I stumbled upon by configuring the latest version of maven in eclipse on a note that says: Embedded runtime is always used for dependency resolution. After a try it did confirm that de dependency resolution was in fact still using the version 3.6.1 of maven even though I added a newer one. For my solution to work, I downloaded an older version of eclipse which is using version 3.5.3 and this one worked just fine. Back to vscode, is it possible for the Maven for Java extension, even though I set a newer or older maven version location with "maven.executable.path" setting name in settings.json, it still uses whatever latest current version of maven? |
@fbricon Hi, when do you plan on upgrading Eclipse Maven Integration (m2e) to version 1.13? I'm 95% confident this will fix it. |
it's been using m2e 1.13.0.20190716-1624 for several releases already |
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. |
right, 3.6.2 is not in the latest m2e release. I'll look into consuming new builds tomorrow |
Hi, 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:
Environment
Steps To Reproduce
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.
The text was updated successfully, but these errors were encountered: