Skip to content

NPE Cannot invoke "String.startsWith(String)" #9180

@OlexYarm

Description

@OlexYarm

Apache NetBeans version

Apache NetBeans 28

What happened

I changed version of JavaFX from "25" to "27-ea+1" in my small home project and project disappeared from projects list in NetBeans.
The project location on GitHub is: https://github.com/OlexYarm/JavaFX-Test-RichTextArea/tree/master
I changed <javafx.version>25</javafx.version> to <javafx.version>27-ea+1</javafx.version>
The NetBeans shows error below:

java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "sourceLevel" is null
	at org.netbeans.modules.maven.classpath.ClassPathProviderImpl$ModuleInfoSelector.getActiveClassPath(ClassPathProviderImpl.java:518)
	at org.netbeans.spi.java.classpath.support.MuxClassPathImplementation.getActiveClassPath(MuxClassPathImplementation.java:156)
	at org.netbeans.spi.java.classpath.support.MuxClassPathImplementation.getResources(MuxClassPathImplementation.java:89)
	at org.netbeans.api.java.classpath.ClassPath.entries(ClassPath.java:363)
	at org.netbeans.modules.parsing.impl.indexing.PathRegistry.createResources(PathRegistry.java:721)
	at org.netbeans.modules.parsing.impl.indexing.PathRegistry.getSources(PathRegistry.java:277)
	at org.netbeans.modules.parsing.impl.indexing.errors.Utilities.findIndexedRootsUnderDirectory(Utilities.java:87)
	at org.netbeans.modules.parsing.ui.indexing.errors.ErrorAnnotator$1.run(ErrorAnnotator.java:295)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)

Language / Project Type / NetBeans Component

JavaFX Maven project

How to reproduce

Clone project from GitHub and make changes.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 11

JDK

Java 25

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    JavaFX[ci] enable JavaFX jobMaven[ci] enable "build tools" testskind:bugBug report or fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions