Issue
I have tried reinstalling netbeans, I have tried reinstalling java. I'm not sure what's going on but I get this exception at random from every class until I restart netbeans. Anyone with similar problems?
run:
Exception in thread "main" java.lang.NoClassDefFoundError: com/company/utilities/formatters/DateFinder
at com.protocase.db.DatabaseAdapter.<init>(DatabaseAdapter.java:44)
at packagingqueries.PackagingQueries.getBatchIDsForOperation(PackagingQueries.java:42)
at packagingqueries.PackagingQueries.main(PackagingQueries.java:20)
Caused by: java.lang.ClassNotFoundException: com.protocase.utilities.formatters.DateFinder
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
Solution
Sometimes, the NetBeans local cache directory becomes corrupted (either because the application crashed earlier or because something else/undefined happened). NetBeans starts to behave strangely. Re-installing does not help, because the local cache directory is not always deleted.
If you are 100% sure your application does not have a path problem:
- Close NetBeans
- If you are on Windows go to c:\Users\youruserid\.netbeans\7.0 (else find the corresponding directory on your system)
- Delete the content completely
- Restart NetBeans
NetBeans will recreate the content of this directory. This may solve your issue. If it does not, then your issue is in the configuration of your application or in a corrupted library for sure.
If the location where these files are stored runs out of space for writing, this problem can arise. As usual, one needs to make space...
Answered By - Jérôme Verstrynge
Answer Checked By - David Goodson (JavaFixing Volunteer)