ClassNotFoundException
報錯:
intellij idea一運行就報錯,找不到類
java.lang.ClassNotFoundException
解決方法:
打開project structures(alt+ctrl+shift+s),查看project–out和module–path–out設置的目錄是否存在。
一般module–path–out設置的是target目錄下的,但是首次運行時沒有target目錄的,必須先用maven build一下才會生成,所以要麼改out路徑,要麼先maven build在運行。
Empty test suite
報錯:
Junit運行時報找不到測試組
Process finished with exit code 1
Class not found: “XXX.XXXTest”Empty test suite.
解決方法:
運行maven test,下載相關jar包
java.lang.NoClassDefFoundError
報錯:
MINAServer Logger–>ERROR{ContextLoader.java:336}-Context initialization failed java.lang.NoClassDefFoundError: Lcom/cebbank/gage/dao/UserDao;
解決方法:
如果要改項目名稱,記得把配置文件(.iml,.idea等)都刪除,只留下項目代碼的文件夾和pom.xml文件,然後重新導入maven項目。