嚴重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListenerjava.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
錯誤:找不到類org.springframework.web.context.ContextLoaderListener
Java虛擬機是根據Java ClassLoader(類加載器)決定如何加載Class。系統默認提供了3個ClassLoaderRoot ClassLoader,ClassPath Loader,Ext ClassLoader我們也可以編寫自己的ClassLoader,去加載特定環境下的Jar文件。能不能加載Jar,加載哪里的Jar,是由ClassLoader決定的。
問題: 導入的僅僅是jar包的引用,例如在eclipse中通過build path加進user lib……(類似快捷方式)這種在Java Application中沒問題,但在web Application中可能會出現找不到類的異常。在WEB Application中jar包最好放在webroot或webcontent下的lib文件夾內,特別是xml中用到的jar包。
解決:1.jar包放在webroot或webcontent下的lib文件夾內
2. 右擊項目名稱-Properties--Deployment Assembly--右邊點擊ADD-Java Build path entries --添加自定義的user-lib
新聞熱點
疑難解答