Spring——Artifact spring:war exploded: Error during artifact deployment. See server log for details
Tomcat加载问题
修改了一个类的名字,使用idea自动修改这个类的名字,修改完之后就报错:
Artifact storage:war exploded: Error during artifact deployment. See server log for details
解决方法1:重新生成war包
1.在tomcat中,将项目的war包删除
2. 在idea->project Settings中将war包删除,并重新打包。
3.在tomcat中,重新加载war包
方法2:重新生成web.xml
查看日志,发现WEB-INF下的web.xml报错。删除web.xml中的配置内容,重新配置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>