春天不喜欢 dispatchServlet

我是春天的新手。我在我的 spring 应用程序中遇到了一个错误。它说 :


    GRAVE: Servlet [dispatcher] in web application [/web-customer-function] threw load() exception

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309)

    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1137)

    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:546)

我已经处理这个问题很长时间了......已经 5 天了。这就是我所做的......

  • 部署程序集 > 将 lib 文件夹添加到路径

  • 停止、清理或/和删除服务器

  • 重写整个代码

  • 下载 org.springframework.web.servlet.DispatcherServlet 并尝试再次运行。

    如果可能的话,我将不胜感激。

这是我的 Web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">

  <display-name>spring-mvc-crud-demo</display-name>


  <welcome-file-list>

    <welcome-file>index.jsp</welcome-file>

    <welcome-file>index.html</welcome-file>

  </welcome-file-list>


  <servlet>

    <servlet-name>dispatcher</servlet-name>

    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

    <init-param>

      <param-name>contextConfigLocation</param-name>

      <param-value>/WEB-INF/spring-mvc-crud-demo-servlet.xml</param-value>

    </init-param>

    <load-on-startup>1</load-on-startup>

  </servlet>


  <servlet-mapping>

    <servlet-name>dispatcher</servlet-name>

    <url-pattern>/</url-pattern>

  </servlet-mapping>

</web-app>

这部分是我的 spring-crud.xml,它们是 bean 和配置......


Helenr
浏览 117回答 1
1回答

有只小跳蛙

我把问题解决了...谢谢大家的帮助,这让我再次思考。所以我从零开始重构代码检查了库,它运行顺利。所以问题出在库上,因为在重构代码后它不起作用。但是检查它工作的库。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java