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环 ...
随机推荐
- Html5 Canvas动画基础碰撞检测的实现
在Canvas中进行碰撞检测,大家往往直接采用游戏引擎(Cocos2d-JS.Egret)或物理引擎(Box2D)内置的碰撞检测功能,好奇的你有思考过它们的内部运行机制吗?下面将针对基本的碰撞检测技术 ...
- Scrapy中的Request和日志分析
Scrapy.http.Request 自动去重,根据url的哈希值,进行去重 属性 meta(dict) 在不同的请求之间传递数据,dict priority(int) 此请求的优先级(默认为0 ...
- CodeForces - 103B(思维+dfs找环)
题意 https://vjudge.net/problem/CodeForces-103B 很久很久以前的一天,一位美男子来到海边,海上狂风大作.美男子希望在海中找到美人鱼 ,但是很不幸他只找到了章鱼 ...
- 苏州市java岗位的薪资状况(2)
上一篇已经统计出了起薪最高的top 10: 接着玩,把top 10 中所有职位的详细信息爬取下来.某一职位的详情是这样: 我们需要把工作经验.学历.职能.关键字爬取下来. from urllib.re ...
- All 432 functions were compiled because no usable IPDB/IOBJ from previous compilation was found
解决方法: 将: 链接器——>优化——>链接时间代码生成——>使用快速链接时间代码生成(/LTCG:incremental). 改为: 链接器——>优化——>链接时间代码 ...
- Day3 - Python基础3 函数基本、递归函数、内置函数
本节内容 1. 函数基本语法及特性 2. 参数与局部变量 2.2. 函数变量作用域 3. 返回值 嵌套函数 4.递归 5.匿名函数 6.函数式编程介绍 7.高阶函数 8.内置函数 1. 函数基本语法及 ...
- 05_javaSE面试题:成员变量和局部变量
题目 /** * 类变量:static修饰的 * 实例变量:不是static修饰的 * * 局部变量:栈 * 实例变量:堆 * 类变量:方法区 * @author kevin * @date 2019 ...
- 剑指Offer-35.两个链表的第一个公共结点(C++/Java)
题目: 输入两个链表,找出它们的第一个公共结点. 分析: 先统计两个链表的长度,计算他们的差值,然后将两个链表对齐,再去寻找公共节点即可. 程序: C++ class Solution { publi ...
- UmiJS 目录及约定
在文件和目录的组织上,umi 更倾向于选择约定的方式. 一个复杂应用的目录结构如下: . ├── dist/ // 默认的 build 输出目录 ├── mock/ // mock 文件所在目录,基于 ...
- 正则表达式中的.*?和python中re.S参数的详解
本章的内容主要是为讲解在正则表达式中常用的.*?和re.S! 在正则表达式中有贪婪匹配和最小匹配:如下为贪婪匹配(.*) import re match = re.search(r'PY.*', 'P ...