eclipse运行maven项目报错java.lang.ClassNotFoundException: xxxxxx

   在eclipse中运行maven项目,出现异常——java.lang.ClassNotFoundException: org.apache.shiro.web.env.EnvironmentLoaderListener。如果确认shiro相关的依赖jar无误,那么可以试着如下操作:

   右键项目——build path——configure build path...——deployment assembly——add——java build path entries——maven dependencies——finish——ok。如下图:

eclipse运行maven项目报错java.lang.ClassNotFoundException: xxxxxxeclipse运行maven项目报错java.lang.ClassNotFoundException: xxxxxx


   重新发布,启动即可。初步分析,问题出现在部署阶段,即部署的时候缺少了依赖jar,所以运行的时候找不到相关类。