2011-04-05 127 views
0

我在運行Eclipse內部的Spring項目時遇到了問題。無法從eclipse運行spring項目,ClassNotFoundException:org.springframework.web.context.ContextLoaderListener

這是錯誤我得到:

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

這裏是Tomcat的設置:

Here are the settings

我不明白爲什麼它不工作,彈簧類都包含在類路徑。

回答

1

你需要彈簧網罐。我看你使用的是maven:

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

注:最新版本是3.0.5.RELEASE。此外,您可以通過包確定彈簧項目,即org.springframework.web

1

我遇到了同樣的錯誤。我去了項目屬性/部署程序集,然後添加了我的彈簧庫。我的項目構建路徑上也有我的彈簧庫。

爲我工作。希望這有助於:]