Eclipse在Tomcat环境下运行项目出现NoClassDefFoundError/ClassNotFoundException解决办法
For this error, there can be different solutions. I have noted down the ones that had worked for me.
Solution 1. This is always happened in deployment and debugging environment. In deployment environment, just make sure your server classpath has included the Spring jar library (e.g spring-4.0.4.jar).
In debugging environment, the steps may vary from different IDE, but the solution is same. In Eclipse, developers usually will create a tomcat, jboss…whatever application server for debugging, just make sure the correct Spring jars are included.
- Double click on your debugging server
- Click on the “Open launch configuration” to access the server environment
- Click on the classpath tab
- Include the Spring jar file here , it may also required common log jar due to Spring dependency.
- Done, run your application again.
.
Solution 2. If you are using Maven as a build tool and downloading dependencies using it, there can be some jar conflict. Because Tomcat servers normally provide some jars such as servlet-api and jpa-api. So if you again included them using maven; there will be problems in identifying them.
Solution 3. If you are using Eclipse as your IDE and using Maven as your build tool and tomcat as your server; remember Tomcat server will not look on the jars which are just inside the folders. For that there's a small trick,
- Right click on your project and select properties
- From the displayed window, select Deployment Assembly
- Select Add
- Add Maven dependencies
- Click Apply and Click OK
Hope one of these solutions would help you to solve your problem. Happy Coding and make sure that is using Java.
Eclipse在Tomcat环境下运行项目出现NoClassDefFoundError/ClassNotFoundException解决办法的更多相关文章
- 在非gnome系桌面环境下运行deepin-wine tim的错误解决
本文通过MetaWeblog自动发布,原文及更新链接:https://extendswind.top/posts/technical/deepin_wine_run_in_not_gnome_desk ...
- IDEA15 下运行Scala遇到问题以及解决办法
为了让Scala运行起来还是很麻烦,为了大家方便,还是记录下来: 1.首先我下载的是IDEA的社区版本,版本号为15. 2.下载安装scala插件: 2.1 进入设置菜单. 2.2 点击安装JetBr ...
- Linux环境下RPM包相互依赖的解决办法
Linux环境下安装Oracle11gR2提示缺少"Package: elfutils-libelf-devel-0.125 FAILED"包,按照提示安装该包时又提示缺少依 ...
- Deepin环境下启动Pycharm没有启动图标解决办法
小伙伴们在deepin下运行pycharm时,是不是需要通过sh文件启动? 下面告诉大家如何将pycharm图标放在桌面上: 1.在桌面打开终端,输入命令: sudo gedit /usr/share ...
- python2.7环境下升级pip3,及出错解决办法
执行 pip3 install --upgrade pip 进行升级 升级后若出现, Import Error:cannot import name main 是因为将pip更新为10.0.0后库里面 ...
- kali linux下运行.sh文件权限不够解决办法
我要装一个生成免杀的神奇,系统提示权限不够 2 于是我想到了sudo,可还是不行 3 于是找到了方法 chmod a+x 文件名 4 再运行一下,成功 5 有时有的方法很简答,只要你愿意找.
- ECLIPSE JSP TOMCAT 环境搭建
ECLIPSE JSP TOMCAT 环境搭建(完整) 要学习一门语言,首先要做的就是搭建环境,然后能写一个小的Demo(类似Helloworld),不仅可以建立信心,而且还可以为之后的学习搭建一个验 ...
- linux 环境下运行STS时 出现must be available in order to run STS
linux 环境下运行ECLIPSE时 出现 “ A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be avai ...
- windows环境下Eclipse开发MapReduce程序遇到的四个问题及解决办法
按此文章<Hadoop集群(第7期)_Eclipse开发环境设置>进行MapReduce开发环境搭建的过程中遇到一些问题,饶了一些弯路,解决办法记录在此: 文档目的: 记录windows环 ...
随机推荐
- mysql-python 安装错误: Cannot open include file: 'config-win.h': No such file or directory
问题描述: pip instal MySQL-python 出现如下错误: Installing collected packages: MySql-python Running setup.py i ...
- Linux:用户权限管理
用户与用户组的概念 超级用户 拥有对系统的最高管理权限,默认是 root 用户 普通用户 只能对自己目录下的文件进行访问和修改,具有登录系统的权限. 虚拟用户 也叫"伪"用户,这类 ...
- JS运动---运动基础(缓冲运动)
(1)手风琴效果 分析: (2)基础缓冲运动 接下来取整 原因: px为计算机识别的最小单位,1px无法再往下拆分.所以css如果取值200.5px,解析时计算机会自动将其改为200px注意:这里的数 ...
- AcWing 44. 分行从上往下打印二叉树
地址 https://www.acwing.com/problem/content/description/42/ 题目描述从上到下按层打印二叉树,同一层的结点按从左到右的顺序打印,每一层打印到一行. ...
- 推荐一款可以直接下载浏览器sources资源的Chrome插件
github地址:https://github.com/up209d/ResourcesSaverExt 经常在仿站的时候回遇到下载别人的图片.css.js等资源,发现要一个个的手动下载.直接使用仿站 ...
- Spring-AOP-配置实现五大通知
码云: xml配置方法:https://gitee.com/MarkPolaris/spring_aop_1 注解配置方法:https://gitee.com/MarkPolaris/spring-e ...
- 函数基础实战之ATM和购物车系统
username_list = [] prize_dict = { '0': "芭比娃娃", '1': "变形金刚", '2': "psp游戏机&qu ...
- typescript里一些有趣的点
联合类型 在原生的JS里,null和undefined经常会导致BUG的产生, 在ts里,你又想用null,又担心出错的时候 你可以考虑用联合类型,当某值可能为 number或null,你可以声明它的 ...
- html公用头部和尾部
这个方式比较简单,样式和js也有效果,还有object和iframe方式 效果图,可以看出公共的样式对于引入的文件也有效果,在加载完文件后js也是有效果的 index.html header.html ...
- Oracle讨论Java 13版本
JDK 13提高了应用程序性能,添加了两种语言功能预览,以及更多JDK 13 根据Oracle Java Team的说法,JDK 13致力于通过提高Java SE平台和JDK的性能,稳定性和安全性来 ...