The environment

  • Linux/Ubuntu20.04 LTS
  • IntelliJ IDEA Community Editon 2021.1
  • java-11-openjdk-amd64
  • Apache tomcat — 7.0.109
  • SSH Framework (Struts2+Spring+Hibernate3)

abnormal

Critical: One or more filters failed to start. Full details will be found in the corresponding container log files on July 8, 2021 9:29:09 afternoon org. Apache. Catalina. Core. StandardContext startInternal severe: Because of the wrong before, the Context [/ ChinaMobile] failed July 08, start 2021 9:29:09 afternoon org. Apache. Coyote. AbstractProtocol start information: Start protocol handling handle ["http-bio-8087"] July 08, 2021 9:29:09 afternoon org. Apache. Catalina. Startup. Catalina start http://localhost:8087/ChinaMobile
  • The project is set up and can start the service on Tomcat, but it cannot run on Tomcat again due to an exception caused by changing the name of the related file or the configuration name of the project
  • Tomcat works fine, if the project cannot be accessed in the browser, that is, the project failed to load the Tomcat container
  • The corresponding container log file does not see any useful exception records

why

  • JAR conflict or missing JAR
  • Web.xml configuration error
  • There is a problem with the Tomcat server configuration
  • The Tomcat port is in use
  • The compiled directory is not correct

Analysis of the

  • If Tomcat started successfully and the project container failed to start, the project compiled correctly, indicating that there were no conflicts or missing JARs for the project, and that the web.xml configuration was correct
  • Restart the computer or restart IDEA, the problem still exists, indicating that the service port is not occupied
  • Invalidate cache from file->… After that, the problem is still at……
  • Delete the compiled code and compile it again. The compiled code is successful, indicating that there is no problem with the compiled code
  • The compiled directory may not be correct. Try modifying the compiled directory and recompile to start Tomcat

plan

  1. /usr/local/apache-tomcat-7.0.109/conf/context.xml(conf/context.xml)
<! -- creat by layuji on 2021-07-01 --> <Loader delegate="true" />
  1. You can see here that the compiled directory is out. Now, after modifying the compiled directory, compile the project in build, and then start Tomcat
 -classpath /home/lauiji/Desktop/java-workspace/HOMEM/out/production/HOMEM AddData

The/home/lauiji/Desktop/Java – workspace/ChinaMobile/out/production/classes

You can see where it was compiled under the Out/Production file and change it to project /WebRoot/ web-inf /classes

File -> Project Structure… -> Modules ->Paths

After modifying the compilation address, restart the project and find that the project can be accessed normally

instructions

  • In the rainy season, eat the rainbow
  • By the individual finishing release, the compilation process is inevitable omissions or mistakes, kindly point out, so as not to mislead everyone!