錯誤:找不到類org.springframework.web.context.ContextLoaderListener

 

嚴重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListenerjava

錯誤:找不到類org.springframework.web.context.ContextLoaderListenerweb

Java虛擬機是根據Java ClassLoader(類加載器)決定如何加載Class。 
系統默認提供了3個ClassLoader 
Root ClassLoader,ClassPath Loader,Ext ClassLoader 
咱們也能夠編寫本身的ClassLoader,去加載特定環境下的Jar文件。 
能不能加載Jar,加載哪裏的Jar,是由ClassLoader決定的。 
spring

問題: 導入的僅僅是jar包的引用,例如在eclipse中經過build path加進user lib……(相似快捷方式) 
這種在Java Application中沒問題,但在web Application中可能會出現找不到類的異常。 
在WEB Application中jar包最好放在webroot或webcontent下的lib文件夾內,特別是xml中用到的jar包。 
app

解決:1.jar包放在webroot或webcontent下的lib文件夾內eclipse

   2. 右擊項目名稱-Properties--Deployment Assembly--右邊點擊ADD-Java Build path entries --添加自定義的user-libui

 

相關文章
相關標籤/搜索