Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
377 views
in Technique[技术] by (71.8m points)

netbeans - java.lang.NoClassDefFoundError from every class every day

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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

  1. Close NetBeans
  2. If you are on Windows go to c:Usersyouruserid.netbeans7.0 (else find the corresponding directory on your system)
  3. Delete the content completely
  4. 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...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...