ssh项目java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoade错误
错误:
导入别人的ssh项目后出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoade错误,
错误发生条件:
别人是用myeclipse10版本,我是用eclipse4.6.0版本运行他的ssh项目,并且他的jar是放在lib目录下的文件夹,也就是说jar包不放在
lib根目录下,而是放在lib目录下的文件夹里。如图:

错误发生原因:
在myeclipse中,会自动扫描lib目录下的所有文件夹的所有jar包,然后编译和运行程序都可以。
而在eclipse中,必须将jar包放在lib目录下,这样程序在运行的时候才能找到jar包,不然即便用Java Build Path (Java Build Path是我们编译需要的包)
导入过的包,没放到lib下,运行项目时会出现ClassNotFoundException的异常.
这里涉及到:eclipse中JavaBuild Path导入包和把包复制到lib下是有区别的,具体可以参考:Eclipse下把jar包放到工程lib下和通过buildpath加载有什么不同
问题解决:
方法一:用myeclipse运行项目
方法二:如果习惯用eclipse,那么就采取Eclipse中用User Library管理jar包
具体步骤(以下内容转自:http://www.cnblogs.com/littlecharacter/archive/2016/06/01/5549059.html):
目的:为了更方便的管理jar包,而不是一股脑儿的将引用的jar包全部放在Web App Library下。
管理和配置:
第一步:管理
新建Library并引入项目中
右键项目->Build Path->Configure Build Path->Add Library->User Library->User Libraries->New->命名->Add External JARs->选jar包->ok,finish,apply










第二步:装配配置
自定义Library不会在项目发布时自动加载到lib下面,会导致启动报错

解决方法:Web Deployment Assembly(Web部署装配)
右键项目->Properties->Deployment Assembly->Add->Java Build Path Entries->选中自定义Library,finish,apply,ok



再次启动,ok

---------------------------------------------------------------------------------------------------------------------------------------
以下可以忽略:
其他解决:
1.若项目的主人是用maven创建spring项目,
ssh项目java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoade错误的更多相关文章
- maven创建spring项目之后,启动报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoade
错误: org.apache.catalina.core.StandardContext listenerStart严重: Error configuring application listener ...
- Intellij 部署项目java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
报错信息: org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener ...
- idea调试SpringMvc, 出现:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener错误的解决办法
有时,使用idea开发SpringMvc发现调试时出现以下错误: 12-Mar-2017 12:08:02.345 严重 [RMI TCP Connection(2)-127.0.0.1] org.a ...
- maven项目启动报:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 错误解决方法-杜恩德
如果你是maven项目,tomcat在发布项目的时候没有同时发布maven依赖所添加的jar包, 你需要设置一下eclipse: 项目 -> 属性 -> Deployment Assemb ...
- maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
maven项目启动tomcat报错: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi ...
- springmvc项目中java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 严重: Error co ...
- 【转】maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
http://blessht.iteye.com/blog/1104450 http://www.cnblogs.com/zhouyalei/archive/2011/11/30/2268606.ht ...
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
maven 导入项目中经常出现这个问题 严重: Error configuring application listener of class org.springframework.web.cont ...
- 使用eclipse启动tomcat里的项目时报错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
1.这种错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener刚开始看的时候 ...
随机推荐
- RobotFrameWork(六)控制流之For循环
转自: http://blog.csdn.net/mengfanbo123/article/details/9033645 For循环 函数结构范例: :For 变量 IN 序列(or 列表) 关 ...
- windows7 启用管理员账户
在虚拟机中安装了windows7,方便使用qq,使用百度云,office等常用的软件.虚拟机使用的oracle的VirtualBox,个人使用体验不错,最棒的功能是能将物理机中的磁盘映射到虚拟机中网络 ...
- 父窗口jquery触发iframe按钮事件(转载)
原文地址: http://blog.csdn.net/muziduoxi/article/details/11123923 <script type="text/javascript& ...
- 问题:QXcbConnection: Could not connect to display
Wkhtmltopdf 失败 (错误代码: -6). 消息: The switch --header-spacing, is not support using unpatched qt, and w ...
- 修改iphone联系人头像
如何通过代码来修改iphone联系人头像 使用如下代码: UIImage *image=[UIImage imageNamed:@"star_full.png"]; NSData ...
- 用netbeans和xdebug调试php的配置
xdebug的chrome.firefox插件 chrome:Xdebug helper firefox:easy Xdebug ----------------------------------- ...
- Pyqt5 获取命令行参数sys.argv
大家有没有注意到,很多软件都能接收第三方应用触发命令行参数,根据参数打开想要的效果. 在windows任务管理器调取命令行列,我们同样能看到进程中有好多是带有参数的. 现在,我们用Pyqt5 (Py3 ...
- C# WebBrowser不能运行打开页面的activex
如果是在64位操作系统中编译的代码,如果activex是32位的那么将不会运行32位的activex. 解决方法:右击项目->属性->生成->目标平台[x86]
- Vitamio
前言 虽然Android已经内置了VideoView组件和MediaPlayer类来支持开发视频播放器,但支持格式.性能等各方面都十分有限,这里与大家一起利用免费的Vitamio来打造属于自己的And ...
- 《DSP using MATLAB》示例Example5.14
代码: x1 = [1,2,2]; x2 = [1,2,3,4]; y = circonvt(x1,x2,4) n1 = 0:1:length(x1)-1; n2 = 0:1:length(x2)-1 ...