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. Set a Many-to-Many Relationship设置多对多关系 (EF)

    In this lesson, you will learn how to set relationships between business objects. For this purpose, ...

  2. OC-类似歌词字体颜色逐字变化的实现方法

    预期实效果图如下: 如上图所示,文字的颜色会根据时间的移动,逐字变成绿色. 实现方法:(1)调用方法: 用 void UIRectFillUsingBlendMode(CGRect rect, CGB ...

  3. Hadoop完全分布式搭建流程

    centos7 搭建完全分布式 Hadoop 环境  SSR 前言 本次教程是以先创建 四台虚拟机 为基础,再配置好一台虚拟机的情况下,直接复制文件到另外的虚拟机中(这样做大大简化了安装流程) 且本次 ...

  4. MVC、MVP与MVVM架构模式

    MVC(Model View Controller): View 层是界面,Model 层是业务逻辑,Controller 层用来调度 View 层和 Model 层, 将用户界面和业务逻辑合理的组织 ...

  5. Docker容器数据卷介绍和命令

    是什么 一句话:有点类似我们Redis里面的rdb和aof文件 先来看看Docker的理念: *  将运用与运行的环境打包形成容器运行 ,运行可以伴随着容器,但是我们对数据的要求希望是持久化的 *   ...

  6. driver.find_element_by_xpath.clear()无法清空输入框默认值

    输入框带默认值,想删除默认值,填写新内容,使用clear()再send_keys(), 发现这种方式无法清除,只会在默认值后面追加新的内容. 上网搜了一下,有两种解决方案,如下: 方法一: 先双击,后 ...

  7. Codeforces Global Round 5

    传送门 A. Balanced Rating Changes 签到,分正负搞一下就行. B. Balanced Tunnel 题意: 给出\(n\)辆车的进洞顺序和出洞顺序,问有多少量车实现了洞中超车 ...

  8. 03. Go 语言容器

    Go语言容器(container) 变量在一定程度上能满足函数及代码要求.如果编写一些复杂算法.结构和逻辑,就需要更复杂的类型来实现.这类复杂类型一般情况下具有各种形式的存储和处理数据的功能,将它们称 ...

  9. Vue STOP&SELF方法使用

    stop属性:停止冒泡只执行到此处 self:只执行当前 代码: <!doctype html> <html lang="en"> <head> ...

  10. Sql Server 判断表是否存在方法总结

    #使用场景: 1.在创建表之前,需要先判断该表是否已经存在: 2.在删除表之前,需要先判断该表是否已经存在: #方法总结: 1.判断实体表是否存在的方法: 1).方法一: * from sysObje ...