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

Tue, Feb 1, 2022 One-minute read

Bugs and Errors Artifact xx exploded: Error during artifact deployment. See server log for details

check the Tomcat Localhost log first,

mine shows:

java.lang.IllegalArgumentException: InputStream cannot be null at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:117) at com.learn.myssm.ioc.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:37)

click the ClassPathXmlApplicationContext

try {
InputStream inputStream = getClass().getClassLoader().getResourceAsStream(path);
//1.创建DocumentBuilderFactory
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
//2.创建DocumentBuilder对象
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder() ;
//3.创建Document对象
Document document = documentBuilder.parse(inputStream);

WEB-INF/web.xml

  <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

applicationContext.xml

  • resources/applicationContext.xml

pom

 <resources>
              <resource>
                  <directory>src/main/resources</directory>
                  <includes>
                      <include>**/*.properties</include>
                      <include>**/*.xml</include>
                  </includes>
                  <filtering>true</filtering>
              </resource>
              <resource>
                  <directory>src/main/java</directory>
                  <includes>
                      <include>**/*.properties</include>
                      <include>**/*.xml</include>
                  </includes>
                  <filtering>true</filtering>
              </resource>
          </resources>

The Code Doesn’t Work.


☕☕☕☕☕☕☕☕

method 1

**1. move the applicationContext.xml from resources to java

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>applicationContext.xml</param-value>
    </context-param>

ignore the red warning, tomcat can work now.