【问题标题】:Can't run spring project from eclipse, ClassNotFoundException: org.springframework.web.context.ContextLoaderListener无法从eclipse运行spring项目,ClassNotFoundException:org.springframework.web.context.ContextLoaderListener
【发布时间】:2011-07-30 08:07:17
【问题描述】:

我在 Eclipse 中运行我的 spring 项目时遇到了问题。

这是我得到的错误:

SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

这里是 Tomcat 设置:

我不明白为什么它不起作用,spring 类包含在类路径中。

【问题讨论】:

    标签: java eclipse spring m2eclipse


    【解决方案1】:

    您需要 spring-web jar。我看到你正在使用 Maven:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.0.5.RELEASE</version>
    </dependency>
    

    注意:最新版本是 3.0.5.RELEASE。另外,您可以通过包来识别spring项目,即org.springframework.web

    【讨论】:

      【解决方案2】:

      我遇到了同样的错误。我去了项目属性/部署程序集,然后添加了我的弹簧库。我的项目构建路径上也有我的 spring 库。

      为我工作。希望这会有所帮助:]

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-01-27
        • 2013-08-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多