Skip to content

Occasional NPE when opening / importing / creating Maven projects #1257

Closed

Description

@brianvfernandes

In STS 4.22.1, occasionally, when opening a Maven project or importing/creating one, the following trace is logged as an error.

java.lang.NullPointerException: Cannot invoke "org.eclipse.m2e.core.project.IMavenProjectFacade.getArtifactKey()" because "facade" is null
	at org.springframework.tooling.jdt.ls.commons.classpath.ClasspathUtil.createProjectBuild(ClasspathUtil.java:235)
	at org.springframework.tooling.jdt.ls.commons.classpath.SendClasspathNotificationsJob.run(SendClasspathNotificationsJob.java:146)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

I'm unsure what the impact of this error is.

To Reproduce
The error does not occur always, you may need multiple attempts of closing and opening a Maven project or creating one before you see it in the log.

It appears to be a race condition where the above code attempts to get Maven metadata before the Maven registry has fully processed the project (as it too is reacting to a new project being available in the workspace).

Activity

  1. self-assigned this
    on May 30, 2024
  2. added this to the 4.23.0.RELEASE milestone on May 31, 2024
  3. BoykoAlex commented on Jun 4, 2024

    @BoykoAlex
    Contributor

    Rework of how GAV are computed for projects pushed in with: ba6fc2a Should fix the NPE reported here.

  4. brianvfernandes commented on Jun 4, 2024

    @brianvfernandes
    ContributorAuthor

    That's quite a change! I have also run into the following NPE occasionally - it occurs only once per session; again, appears to be a race condition. Would this also be fixed by the GAV rework? Please let me know if I should file another issue.

    !MESSAGE NullPointerException: Cannot invoke "org.springsource.ide.eclipse.commons.livexp.core.LiveSetVariable.getValue()" because "this.this$0.applications" is null
    !STACK 0
    java.lang.NullPointerException: Cannot invoke "org.springsource.ide.eclipse.commons.livexp.core.LiveSetVariable.getValue()" because "this.this$0.applications" is null
    	at org.springframework.ide.eclipse.boot.dash.model.LocalBootDashModel$2.bundleChanged(LocalBootDashModel.java:157)
    	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:972)
    	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:341)```
    
  5. BoykoAlex commented on Jun 4, 2024

    @BoykoAlex
    Contributor

    No the NPE above is not related to GAVs. It is a straight-forward NPE fix: 6de76d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

for: eclipsetype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions