转载自:http://www.cnblogs.com/love540376/p/5527757.html

Eclipse中tomcat部署工程启动后报错:

  1. 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
  2. java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
  3. at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
  4. at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
  5. at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
  6. at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
  7. at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
  8. at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
  9. at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
  10. at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
  11. at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
  12. at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  13. at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  14. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  15. at java.lang.Thread.run(Thread.java:662)

问题背景

工程为maven工程,ContextLoaderListener类位于spring-web-3.1.0.RELEASE.jar包中。检查了maven的pom.xml,依赖引入正常。在工程Maven Dependencies视图中也能看到spring-web-3.1.0.RELEASE.jar包被正常引入进来了。

错误原因:

进入到tomcat的部署路径.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\下检查了一下,发现工程部署后在WEB-INF文件夹下没有生成lib目录,正常情况下,会生成lib目录并把工程的所有依赖jar包都部署到该目录下。

解决方案:

1.右键点击项目--选择Properties

选择Deployment Assembly,在右边点击Add按钮,在弹出的窗口中选择Java Build Path Entries。如下图所示:

2.点击Next,选择Maven Dependencies

3.点击Finish,然后可以看到已经把Maven Dependencies添加到Web应用结构中了

操作完后,重新部署工程,不再报错了。然后我们再到.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\目录下,发现工程WEB-INF目录下自动生成了lib目录,并且所有的依赖jar包也都已经部署进来。问题因此解决。

(转载)Eclipse报错:java.lang.ClassNotFoundException: ContextLoaderListener的更多相关文章

  1. 【ContextLoaderListener】Web项目启动报错java.lang.ClassNotFoundException: ContextLoaderListener

    错误原因: 进入到tomcat的部署路径.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\下检查了一下,发现工程部署后在WE ...

  2. maven web 项目中启动报错 Java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

    主要原因是maven项目里面的jar包吗,没有导入到项目中 maven web 项目中启动报错 Java.lang.ClassNotFoundException: org.springframewor ...

  3. 项目报错java.lang.ClassNotFoundException: org.common.SessionListener

    现象:项目报错java.lang.ClassNotFoundException: org.common.SessionListener,并且myeclipse左侧Package Explorer中项目 ...

  4. 报错:java.lang.ClassNotFoundException: io.opentracing.util.GlobalTracer

    报错:java.lang.ClassNotFoundException: io.opentracing.util.GlobalTracer 近来在做一个在线教育的项目,课程信息放在数据库,而视频放在阿 ...

  5. idea数据库报错java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

    通过idea操作数据库,进行数据的增加,运行时报错java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 原因:没有导入mysql-connec ...

  6. maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    maven项目启动tomcat报错: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi ...

  7. eclipse中启动tomcat报错 java.lang.ClassNotFoundException

    之前启动还好好的,某次启动tomcat就莫名其妙的报了这个java.lang.ClassNotFoundException的错.   检查maven依赖包,发现这个类是存在的. 然后一通clean操作 ...

  8. maven创建spring项目之后,启动报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    出错情景:maven中已经加载了spring的核心包,但是项目启动时,报错: org.apache.catalina.core.StandardContext listenerStart严重: Err ...

  9. 【web.xml】报错java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    今天搭建新的项目,虽然在web.xml中配置了ContextLoaderListener以及IntrospectorCleanupListener 如下: web.xml中部分代码: <!-- ...

  10. eclipse下执行maprdeuc程序报错 java.lang.ClassNotFoundException

    最近遇到一个问题,不知怎么突然运行hadoop的map程序报错,困扰了我很久,现在来给大家分享分享.. 错误信息 2017-05-18 21:34:22,104 INFO [main] client. ...

随机推荐

  1. python中的excel操作

    一. Excel在python中的应用 存测试数据 有的时候大批量的数据,我们需要存到数据库中,在测试的时候才能用到.测试的时候就从数据库中读取出来.这点是非常重要的! 存测试结果 二. Excel中 ...

  2. zoj 3963 Heap Partition(并查集,贪心,二分)

    Heap Partition Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge A sequence S = { ...

  3. Leetcode 509. Fibonacci Number

    class Solution(object): def fib(self, N): """ :type N: int :rtype: int ""&q ...

  4. java入门学习(1)一简介及其基础特点

    分类: java基础 1.为什么java如此流行,为什么历史选择了它? 因为它拥有全新的编程思想,更接近人们的语言习惯,由于其编译器把代码编译成字节码,然后再不同的平台上运行分别用不同的虚拟机去解释字 ...

  5. Sortable

    d_(:з」∠)_ import React, {Component} from 'react'; import "./app.css"; import Sortable from ...

  6. CodeChef - SQRGOOD:Simplify the Square Root (求第N个含平方因子数)

    Tiny Wong the chef used to be a mathematics teacher in a senior high school. At that time, he always ...

  7. npm install -d

    nodejs Error: Cannot find module 'xxx'错误 解决方案: 确定package.json里有添加相应的依赖配置 使用npm install -d 可以自动配置pack ...

  8. Oracle中查询前10条记录

    在Oracle怎样查询表中的top10条记录呢? select * from test where rownum <=10     ----说明:rownum只能用于<或<=运算,如 ...

  9. 基于spring及zookeeper的dubbo工程搭建

    一.生产者搭建 新建一个maven工程,勾选Create a simple project Packaging方式选择jar包的方式. 修改pom.xml文件: <project xmlns=& ...

  10. 《hadoop权威指南》关于hive的第一个小例子的演示

    本文是<hadoop权威指南>关于hive的小例子,通过这个例子可以很好地看出来hive是个什么东西. 前提是已经配置好hive的远程连接版本的环境,我是用了MYSQL数据库保存元数据. ...