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.

  1. Double click on your debugging server
  2. Click on the “Open launch configuration” to access the server environment
  3. Click on the classpath tab
  4. Include the Spring jar file here , it may also required common log jar due to Spring dependency.
  5. 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,

  1. Right click on your project and select properties
  2. From the displayed window, select Deployment Assembly
  3. Select Add
  4. Add Maven dependencies
  5. 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.

原文地址:https://stackoverflow.com/questions/15989325/java-lang-noclassdeffounderror-org-springframework-context-applicationcontext/22746332#22746332

Eclipse在Tomcat环境下运行项目出现NoClassDefFoundError/ClassNotFoundException解决办法的更多相关文章

  1. 在非gnome系桌面环境下运行deepin-wine tim的错误解决

    本文通过MetaWeblog自动发布,原文及更新链接:https://extendswind.top/posts/technical/deepin_wine_run_in_not_gnome_desk ...

  2. IDEA15 下运行Scala遇到问题以及解决办法

    为了让Scala运行起来还是很麻烦,为了大家方便,还是记录下来: 1.首先我下载的是IDEA的社区版本,版本号为15. 2.下载安装scala插件: 2.1 进入设置菜单. 2.2 点击安装JetBr ...

  3. Linux环境下RPM包相互依赖的解决办法

    Linux环境下安装Oracle11gR2提示缺少"Package: elfutils-libelf-devel-0.125    FAILED"包,按照提示安装该包时又提示缺少依 ...

  4. Deepin环境下启动Pycharm没有启动图标解决办法

    小伙伴们在deepin下运行pycharm时,是不是需要通过sh文件启动? 下面告诉大家如何将pycharm图标放在桌面上: 1.在桌面打开终端,输入命令: sudo gedit /usr/share ...

  5. python2.7环境下升级pip3,及出错解决办法

    执行 pip3 install --upgrade pip 进行升级 升级后若出现, Import Error:cannot import name main 是因为将pip更新为10.0.0后库里面 ...

  6. kali linux下运行.sh文件权限不够解决办法

    我要装一个生成免杀的神奇,系统提示权限不够 2 于是我想到了sudo,可还是不行 3 于是找到了方法 chmod   a+x   文件名 4 再运行一下,成功 5 有时有的方法很简答,只要你愿意找.

  7. ECLIPSE JSP TOMCAT 环境搭建

    ECLIPSE JSP TOMCAT 环境搭建(完整) 要学习一门语言,首先要做的就是搭建环境,然后能写一个小的Demo(类似Helloworld),不仅可以建立信心,而且还可以为之后的学习搭建一个验 ...

  8. 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 ...

  9. windows环境下Eclipse开发MapReduce程序遇到的四个问题及解决办法

    按此文章<Hadoop集群(第7期)_Eclipse开发环境设置>进行MapReduce开发环境搭建的过程中遇到一些问题,饶了一些弯路,解决办法记录在此: 文档目的: 记录windows环 ...

随机推荐

  1. Java操作数据库——使用连接池连接数据库

    Java操作数据库——使用连接池连接数据库 摘要:本文主要学习了如何使用JDBC连接池连接数据库. 传统方式和连接池方式 传统方式的步骤 使用传统方式在Java中使用JDBC连接数据库,完成一次数据库 ...

  2. Java后端高频面试题汇总

    Java后端面试题汇总 近来,分专题更新了Java后端面试题,此文章对这些文章做一个目录式的整理,方便查看 1.Java基础   https://www.cnblogs.com/autism-dong ...

  3. Use a Multiline Editor for String Properties 对字符串属性使用多行编辑器

    In this lesson, you will learn how to display a multiline editor for string properties. For this pur ...

  4. 松软科技web课堂:SQLServer之MID() 函数

    MID() 函数 MID 函数用于从文本字段中提取字符. SQL MID() 语法 SELECT MID(column_name,start[,length]) FROM table_name 参数 ...

  5. 轻松搞定项目中的空指针异常Caused by: java.lang.NullPointerException: null

    大家在项目测试过程中,是不是经常会碰到这个空指针异常呢Caused by: java.lang.NullPointerException: null 当大家遇到这个问题,大家是怎么处理?自己解决还是让 ...

  6. MySQL第四课

    CREATE TABLE biao(    name VARCHAR(20) PRIMARY KEY,    age INT(11) NOT NULL,    sex CHAR(11)DEFAULT ...

  7. vi 中按了 Ctrl+S 后死机不能动怎么办?

    我们下意识想保存文档时,会不知觉地按下 Ctrl+S 组合键.但如果是正在 Linux 的 Shell 中使用 vi 编辑文本,这么按就糟了,会直接出现卡住.不能动.卡死的现象. 不过,后来我搞明白了 ...

  8. June 01st, 2019. Week 22nd, Saturday

    It is the childlike mind that finds the kingdom. 正是你的童心帮你找到属于自己的王国. From Charles Fillmore. When we w ...

  9. Note | 北航《网络安全》复习笔记

    目录 1. 引言 2. 计算机网络基础 基础知识 考点 3. Internet协议的安全性 基础知识 考点 4. 单钥密码体制 基础知识 考点 5. 双钥密码体制 基础知识 考点 6. 消息认证与杂凑 ...

  10. 【STM32H7教程】第16章 STM32H7必备的HAL库API(重要)

    完整教程下载地址:http://www.armbbs.cn/forum.php?mod=viewthread&tid=86980 第16章       STM32H7必备的HAL库API(重要 ...