Spring——Artifact spring:war exploded: Error during artifact deployment. See server log for details

created at 01-08-2022 views: 695

Tomcat loading problem

Modify the name of a class, use idea to automatically modify the name of the class, and report an error after modification:

Artifact storage:war exploded: Error during artifact deployment. See server log for details

Solution 1: Regenerate the war package

1 In tomcat, delete the war package of the project

delete war package

2 Delete the war package in idea->project Settings and repackage it.

delete war package

deployment

3 In tomcat, reload the war package

reload package

Method 2: Regenerate web.xml

Check the log and find that the web.xml under WEB-INF reports an error. Delete the configuration content in web.xml and reconfigure xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">

    <servlet>
        <servlet-name>dispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:springmvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcherServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>
created at:01-08-2022
edited at: 01-08-2022: