Tomcat reports an error when starting the springboot project war package: Error when starting the child

Tomcat reports an error when starting the springboot project war package: Error when starting the child

Today, the company's springboot project is ready to be deployed to the test server for testing. After packaging the war file and putting it into tomcat for startup, the front-end files can be accessed, but the interface request has always been 404. I have been looking for the reason for a long time. The tomcat startup is successful, and the war packaging also prompts build success. The tomcat startup log found an error:

java.lang.IllegalStateException: Error starting child
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1848)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:738)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Caused by: org.apache.catalina.LifecycleException: Initialization of component [org.apache.catalina.webresources.JarResourceSet@67d48005] failed.
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:726)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4792)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4928)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
... 37 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: error in opening zip file
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 44 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:221)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:206)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
... 45 more

I have been paying attention to: an error occurred when starting the child level. I have been looking for a solution for a long time! Later, I paid attention to the following zip error problem, and then went back to consider the packaging problem. Finally, I found that there was a problem during packaging. Although the build was successful in the end, the error was prompted before but I didn’t notice it. The screenshot is as follows:

This is the problem, how to solve it?

Solution:

Delete the jar package with the error from the Maven repository, then download and package it again. I found that there was no error this time. Then I threw it into Tomcat to start it. There was no error log and the access was normal!

I would like to use this article to record and remind myself to pay more attention to the project execution, packaging and other processes and logs in the future!

Summarize

This is the end of this article about Tomcat starting springboot project war package error: Error solution when starting child. For more related content about Tomcat starting springboot project war package error, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to dynamically specify the environment with commands when starting a Springboot project
  • Admin - SpringBoot + Maven multi-start environment configuration example detailed explanation
  • IDEA2020.1 starts the SpringBoot project and the java package: xxx does not exist
  • Solution to 404 when starting SpringBoot+jsp project
  • How to start and stop scripts for SpringBoot projects under Centos
  • How to start the springboot project and specify the corresponding environment

<<:  js to achieve a simple carousel effect

>>:  Briefly describe mysql monitoring group replication

Recommend

Detailed introduction to MySQL database index

Table of contents Mind Map Simple understanding E...

Example of how to configure cross-domain failure repair in nginx

Nginx cross-domain configuration does not take ef...

Web design tips on form input boxes

This article lists some tips and codes about form...

Implementation of textarea adaptive height solution in Vue

Table of contents Hidden Problems Solution to ada...

How to build a K8S cluster and install docker under Hyper-V

If you have installed the Win10 system and want t...

Solution for Tomcat to place configuration files externally

question When we are developing normally, if we w...

How to Dockerize a Python Django Application

Docker is an open source project that provides an...

A small introduction to the use of position in HTML

I just learned some html yesterday, and I couldn&#...

A simple example of how to implement fuzzy query in Vue

Preface The so-called fuzzy query is to provide q...

Vue.js implements calendar function

This article example shares the specific code of ...

Summary of Mysql-connector-java driver version issues

Mysql-connector-java driver version problem Since...

Solve the problem of VScode configuration remote debugging Linux program

Let's take a look at the problem of VScode re...

Example of how to create a local user in mysql and grant database permissions

Preface When you install MySQL, you usually creat...

How to connect to MySQL visualization tool Navicat

After installing Navicat The following error may ...