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环 ...
随机推荐
- viewPager作为RecyclerView的itemView出现的显示问题
版权声明:本文为xing_star原创文章,转载请注明出处! 本文同步自http://javaexception.com/archives/174 ViewPager作为RecyclerView的it ...
- Thymeleaf对象的使用:日期对象
Thymeleaf在模板中使用 #dates 或 #calendars 两个对象来处理日期,这两个对象大部分类似. 开发环境:IntelliJ IDEA 2019.2.2Spring Boot版本:2 ...
- SQL Server要拷贝默认目录下的使用数据库需要停止的服务
- MySQL数据库(二)事务
MySQL的存储引擎InnoDB支持事务,MyISAM不支持事物 数据库事务的四大特性(ACID) 原子性(atomic) 原子性是指事务包含的所有操作要么全部成功,要么全部失败回滚,这和前面两篇博客 ...
- 阿里云ubuntu 16.04 搭建pptpd 第二版
前言:1.我常用的服务器在国内,但我又有某方面的需求,所以想要搭建一个pptpd的服务器 2.但我又不常用,所以感觉阿里云包年包月的不划算,所以准备采用阿里云按量付费的实例来搭建pptpd,并形 ...
- Re-DD-androideasy
题目地址 https://dn.jarvisoj.com/challengefiles/DDCTF-Easy.apk.64812266499cc050ac23e190e53b87f7 用JEB打开 返 ...
- Acwing40. 顺时针打印矩阵
地址 https://www.acwing.com/solution/acwing/content/3623/ 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字. 样例 输入: [ [, ...
- 超实用的Java web面试题
Java web面试题 1.Tomcat的优化经验 答:去掉对web.xml的监视,把jsp提前编辑成Servlet. 有富余物理内存的情况,加大tomcat使用的jvm的内存 2.HTTP请求的GE ...
- JavaScript中如何判断数组类型
前言 JavaScript中关于数组的判定问题,一直都是一个必须要掌握的点,那么,运用知识,如何判断一个类型是数组,就需要有对JavaScript使用有着深入的了解. 判断方法 一.Array.isA ...
- css 适配
https://blog.csdn.net/weixin_35467885/article/details/80778992 1.通过link方法 link方法引入媒体类型其实就是在标签引用样式的时候 ...