netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Lots of NoClassDefFoundError logged

Open mlindsten opened this issue 1 year ago • 8 comments

Apache NetBeans version

Apache NetBeans 23

What happened

I recently upgraded from 20 to 23 and now I'm having problems with "Unexpected Exception" frequently showing up in the Notifications panel and the IDE feeling generally buggy. I have looked in messages.log and seen that most of the exceptions (different kinds) are caused by NoClassDefFoundError (for different classes).

I've uninstalled NB (including all previous versions) and reinstalled it but to no avail. Before I upgraded I had been using NB 20 without any problems for several months. However, during a larger refactoring NB froze and I had to terminate the process. After that I started getting error messages when starting NB and it acted generally buggy and froze multiple times. That's why I upgraded to 23.

Language / Project Type / NetBeans Component

Java web application with Maven and Git

How to reproduce

I'm not doing anything special, that I know of. I just work with (edit) normal Java files and sometimes SQL files. I've noticed that some of the exceptions are Git related, but the only Git related feature I use in NB is sometimes looking at the history of a file.

Did this work correctly in an earlier version?

Apache NetBeans 20

Operating System

Windows 10 version 10.0 running on amd64

JDK

21.0.2; OpenJDK 64-Bit Server VM 21.0.2+13-58; Oracle Corporation

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

mlindsten avatar Oct 07 '24 08:10 mlindsten

These are the different NoClassDefFoundError currently logged:

NoClassDefFoundError: Could not initialize class org.netbeans.libs.git.GitBranch
NoClassDefFoundError: Could not initialize class org.netbeans.modules.java.lsp.server.protocol.Server
NoClassDefFoundError: com/google/gson/GsonBuilder
NoClassDefFoundError: com/google/gson/JsonElement
NoClassDefFoundError: org/eclipse/core/runtime/CoreException
NoClassDefFoundError: org/eclipse/core/runtime/IRegistryChangeListener
NoClassDefFoundError: org/eclipse/core/runtime/IStatus
NoClassDefFoundError: org/eclipse/core/runtime/Plugin
NoClassDefFoundError: org/eclipse/jgit/lib/ObjectId
NoClassDefFoundError: org/eclipse/jgit/transport/CredentialsProvider
NoClassDefFoundError: org/eclipse/jgit/transport/ssh/jsch/JschConfigSessionFactory

mlindsten avatar Oct 07 '24 08:10 mlindsten

Hi, according to your log lots of osgi are missing. Activator is not found and so one. This may lead to the later error. Maybe removing/reinstalling nb23 may help

ebarboni avatar Oct 07 '24 09:10 ebarboni

Maybe removing/reinstalling nb23 may help

I have already tried this and it did not help.

mlindsten avatar Oct 07 '24 09:10 mlindsten

including manually removing cache in AppData\Local\NetBeans\Cache\23 and data in AppData\Roaming\NetBeans\23 ? just to be sure

ebarboni avatar Oct 07 '24 09:10 ebarboni

Ah, no, that I haven't done!

Does that mean that I will have to redo all my settings (which I normally import when upgrading)?

mlindsten avatar Oct 07 '24 09:10 mlindsten

First see if not importing settings fixes your issue!

You can always import some or all of your settings later by using the Import button in Tools / Options.

neilcsmith-net avatar Oct 07 '24 09:10 neilcsmith-net

this must be indeed the config import, since I diffed the module list of your log with a fresh NB 23 install startup (java, EE and maven cluster active) and both were identical (except windows/linux differences which is to be expected).

Issues like this typically happen when something doesn't load for whatever reason, but this doesn't seem to be the case here. Would be still curious to find out what the cause is.

mbien avatar Oct 08 '24 22:10 mbien

I have now uninstalled, removed NB folders (from AppData\Local, AppData\Roaming and Program Files) and reinstalled. I haven't imported any settings and will instead redo all settings manually, to be on the safe side.

It seems much more stable now (no unexpected exceptions yet). Keeping my fingers crossed!

Thanks for the help!

mlindsten avatar Oct 09 '24 07:10 mlindsten

@mlindsten I hope everything is still working fine ;) closing

mbien avatar Sep 12 '25 08:09 mbien