Skip to content
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

Netbeans not being able to open any project #8040

Open
talos12121 opened this issue Dec 12, 2024 · 5 comments
Open

Netbeans not being able to open any project #8040

talos12121 opened this issue Dec 12, 2024 · 5 comments
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@talos12121
Copy link

Apache NetBeans version

Apache NetBeans 23

What happened

I have been using the program for quite some time now and now all of a sudden I cant open any project. Every time I press open project it returns with an unexpected exception. The message is the following, Cannot invoke "String.matches(String)"because the return value of "java.io.File.to.String()"is null. If I press show details it also shows that a java.lang.NullPointerException has occured. I have tried uninstalling netbeans and reinstalling it several times and still the same thing. I did the same thing with the jdk but I still get the same error
messages.log

Language / Project Type / NetBeans Component

NetBeans Platform Application

How to reproduce

basically just by pressing open project or pressing ctrl+shift+o it should show the unexpected exception message I mentioned above

Did this work correctly in an earlier version?

No / Don't know

Operating System

windows 11 version 10.0

JDK

jdk-23_windows-x64_bin

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

Basically the problem occurs every time I try to open a project in netbeans

Are you willing to submit a pull request?

Yes

@talos12121 talos12121 added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Dec 12, 2024
@mbien
Copy link
Member

mbien commented Dec 13, 2024

  Product Version         = Apache NetBeans IDE 23
  Operating System        = Windows 11 version 10.0 running on amd64
  Java; VM; Vendor        = 23.0.1; Java HotSpot(TM) 64-Bit Server VM 23.0.1+11-39; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 23.0.1+11-39

...

java.lang.NullPointerException: Cannot invoke "String.matches(String)" because the return value of "java.io.File.toString()" is null
	at org.netbeans.modules.project.ui.ProjectChooserAccessory$ProjectFileView.getIcon(ProjectChooserAccessory.java:578)
	at java.desktop/javax.swing.JFileChooser.getIcon(JFileChooser.java:1607)
	at org.netbeans.swing.dirchooser.DirectoryChooserUI$DirectoryComboBoxRenderer.getListCellRendererComponent(DirectoryChooserUI.java:1843)
	at java.desktop/javax.swing.plaf.basic.BasicComboBoxUI.getDisplaySize(BasicComboBoxUI.java:1446)
	at com.formdev.flatlaf.ui.FlatComboBoxUI.getDisplaySize(FlatComboBoxUI.java:712)

Interesting. I don't see how File#toString could return null, the way File is constructed it would fail much earlier if the path would resolve to null.

https://github.com/openjdk/jdk/blob/367c3041272d43b0474b433c555f22a3e15579f6/src/java.base/share/classes/java/io/File.java#L2004-L2006

https://github.com/openjdk/jdk/blob/367c3041272d43b0474b433c555f22a3e15579f6/src/java.base/share/classes/java/io/File.java#L520-L522

the code around ProjectChooserAccessory did also not change in a while.

@mbien
Copy link
Member

mbien commented Dec 13, 2024

btw as workaround you should be able to drag and drop projects directly into the editor or navigate to them using the favorites window to use right click open.

Resetting your config might also fix this issue for you. But this won't help finding out what the cause for this was.

The project folder which the dialog is opening by default is remembered as property in projectui.properties which should be in
C:/Users/varda/AppData/Roaming/NetBeans/23/config/Preferences/org/netbeans/modules/ in your case. Or if you use project groups in the groups sub folders.

@talos12121
Copy link
Author

I found a solution for that. I uninstalled java, the jdk and also netbeans. After that, I updated windows, reinstalled java then a previous version of jdk (in my case jdk 19) which I was using on my second pc and lastly I installed netbeans 17 which I was also using on my second pc. I think I probably had to uninstall java completely and then install them with that specific order. I will also try to install the latest version of jdk and netbeans. Thanks for the help

@neilcsmith-net
Copy link
Member

Make sure to delete the NB23 userdir and cachedir before attempting to upgrade again.

@mbien could it be not properly protected in case of deserialization?

@mbien
Copy link
Member

mbien commented Dec 13, 2024

@neilcsmith-net serialization could explain why a field is null in java.io.File yeah.

@mbien mbien reopened this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

3 participants