spring 3.2.0 classnotfoundexception

时间:2013-01-14 16:18:41

标签: java spring spring-mvc

我收到以下错误:

java.lang.ClassNotFoundException: org.springframework-web.servlet.DispatcherServlet
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1062)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4935)
    at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5262)
    at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5257)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

我在WEB-INF / lib目录中得到了这些.jar

spring-beans-3.2.0.RELEASE.jar
spring-context-3.2.0.RELEASE.jar
spring-core-3.2.0.RELEASE.jar
spring-expression-3.2.0.RELEASE.jar
spring-webmvc-3.2.0.RELEASE.jar
spring-web-3.2.0.RELEASE.jar

我还需要什么?

2 个答案:

答案 0 :(得分:3)

如果包名中没有破折号,则应为org.springframework.web.servlet.DispatcherServlet。你的web.xml可能只是一个错字吗?

答案 1 :(得分:0)

可能导致例外的因素:

  1. Jars未添加到WEB-INF/lib目录
  2. web.xml
  3. 中未正确配置DispatcherServlet引用

    您可以上传web.xml,项目结构并验证上述信息吗?