今天安裝和部署maven項目的時候一直都出現這樣的錯誤:
maven項目出現:Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
按照網上的好多都是說spring.jar包什么的問題,但是我這個項目修改了也沒有效果的樣子,后來自己嘗試了一下,發現是maven的包沒成功導入項目中:
在eclipse中:如果在這樣:右擊 Maven project --> Macven --> Enable Dependency Management 不行的,就如下:
然后選擇添加maven dependences相關包。然后右擊項目-->maven-->update project
最后從新部署。
MyEclipse中要注意jdk的版本一致: