说明项目没有加载jar包
异常:Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
解决方案:对着工程点右键->Properties ->搜 Deployment Assembly -> Add--> Folder -->选择 lib(eclipse中位于webContent下,myeclipse中位于webRoot下) --> apply
注意:我的jar都放在工程下的lib文件夹,这样子tomcat运行时就不会报找不到class了
本文详细介绍了当项目中出现java.lang.NoClassDefFoundError:org/springframework/web/context/WebApplicationContext异常时的解决方法。主要步骤是在工程的DeploymentAssembly中添加lib文件夹,确保tomcat能正确加载jar包。
7291

被折叠的 条评论
为什么被折叠?



