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. 在做nav-bar部分点击路由跳转相同地址时,控制台报错问题。

    报错信息: Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: &qu ...

  2. 【转载】从使用到原理学习Java线程池

    线程池的技术背景 在面向对象编程中,创建和销毁对象是很费时间的,因为创建一个对象要获取内存资源或者其它更多资源.在Java中更是如此,虚拟机将试图跟踪每一个对象,以便能够在对象销毁后进行垃圾回收. 所 ...

  3. 创建密钥并使用密钥ssh登录linux

    创建密钥并使用密钥ssh登录linux 使用密钥对登录ssh简介 通过ssh_keygen胜场公钥和私钥,公钥放在要登录的目标的机器上,私钥放登录发起的机器上. 生成密钥 我是在ubuntu上生成的密 ...

  4. BIM工程信息管理新系统- 系统管理模块

    系统管理模块 1.实体类 public partial class T_Role { public string RoleId { get; set; } public string RoleName ...

  5. linux 命令cp -a的用法

    cp -a 保留原文件属性的前提下复制文件 cp -r dirname(源文件) destdi(目标文件) 复制目录后其文件属性会发生变化想要使得复制之后的目录和原目录完全一样包括文件权限,可以使用c ...

  6. AcWing 27. 数值的整数次方

    地址 https://www.acwing.com/problem/content/description/26/ 题目描述实现函数double Power(double base, int expo ...

  7. 如何理解Virtual DOM

    什么是虚拟DOM 接下来用vdom(Virtual DOM)来简称为虚拟DOM. 指的是用JS模拟的DOM结构,将DOM变化的对比放在JS层来做.换而言之,虚拟DOM就是JS对象.如下DOM结构: & ...

  8. 前端 web mime类型引起的 常见404错误

    mime 类型设置参考https://www.w3school.com.cn/media/media_mimeref.asp

  9. golang:exported function Script should have comment or be unexported

    当自己定义的包被外部使用时,如果不遵循一定的规范,那么会出现讨厌的绿色纹条,还会警告: 虽然不会影响运行,但是也令人讨厌,那么如何解决这个问题呢? 为结构体或者变量或者方法添加注释,并且开头必须是结构 ...

  10. 用OC基于链表实现链队列

    一.简言 在前面已经用C++介绍过链队列的基本算法,可以去回顾一下https://www.cnblogs.com/XYQ-208910/p/11692065.html.少说多做,还是上手撸代码实践一下 ...