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

JavaScript uses promise to handle multiple repeated requests

1. Why write this article? You must have read a l...

Mini Program to Implement Slider Effect

This article example shares the specific code for...

HTML hyperlink style (four different states) setting example

Copy code The code is as follows: <style type=...

An article to help you understand jQuery animation

Table of contents 1. Control the display and hidi...

Detailed explanation of data types in JavaScript basics

Table of contents 1. Data Type 1.1 Why do we need...

How can MySQL effectively prevent database deletion and running away?

Table of contents Safe Mode Settings test 1. Upda...

In-depth explanation of MySQL learning engine, explain and permissions

engine Introduction Innodb engine The Innodb engi...

Analysis of the use and principle of Docker Swarm cluster management

Swarm Cluster Management Introduction Docker Swar...

my.cnf parameter configuration to optimize InnoDB engine performance

I have read countless my.cnf configurations on th...

Docker container orchestration implementation process analysis

In actual development or production environments,...

How to generate a unique server-id in MySQL

Preface We all know that MySQL uses server-id to ...

Vue page monitoring user preview time function implementation code

A recent business involves such a requirement tha...