Tomcat启动springboot项目war包报错:启动子级时出错的问题
今天公司springboot项目准备部署到测试服务器上进行测试,打包好war后放到tomcat里面启动后,前端文件能访问到,但是接口请求一直是404,一直找了很久的原因,tomcat启动是成功的,war打包的时候也提示buildsuccess了,tomcat启动日志发现报错:
java.lang.IllegalStateException:启动子级时出错
atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
atorg.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
atorg.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1848)
atjava.util.concurrent.Executors$RunnableAdapter.call(UnknownSource)
atjava.util.concurrent.FutureTask.run(UnknownSource)
atorg.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
atjava.util.concurrent.AbstractExecutorService.submit(UnknownSource)
atorg.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
atorg.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
atorg.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
atorg.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
atorg.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
atorg.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
atorg.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
atorg.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
atorg.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
atjava.util.concurrent.FutureTask.run(UnknownSource)
atorg.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
atjava.util.concurrent.AbstractExecutorService.submit(UnknownSource)
atorg.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
atorg.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
atorg.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
atorg.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
atorg.apache.catalina.startup.Catalina.start(Catalina.java:738)
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
atsun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(UnknownSource)
atjava.lang.reflect.Method.invoke(UnknownSource)
atorg.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
atorg.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Causedby:org.apache.catalina.LifecycleException:初始化组件[org.apache.catalina.webresources.JarResourceSet@67d48005]失败。
atorg.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
atorg.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
atorg.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:726)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
atorg.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4792)
atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4928)
atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
...37more
Causedby:java.lang.IllegalArgumentException:java.util.zip.ZipException:errorinopeningzipfile
atorg.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
atorg.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
...44more
Causedby:java.util.zip.ZipException:errorinopeningzipfile
atjava.util.zip.ZipFile.open(NativeMethod)
atjava.util.zip.ZipFile.(UnknownSource)
atjava.util.zip.ZipFile.(UnknownSource)
atjava.util.jar.JarFile.(UnknownSource)
atjava.util.jar.JarFile.(UnknownSource)
atorg.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:221)
atorg.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:206)
atorg.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
...45more
一直在关注:启动子级时出错,找了很久没有解决!后面关注到下面的zip错误问题,然后再回去考虑打包的问题,终于发现打包的时候出现了问题,虽然最后是buildsuccess,但是前面提示了有error没注意到,截图如下:
这就是问题所在,怎么解决的呢?
解决方法:
将报错的jar包从maven仓库中删除掉,然后重新下载打包,发现这一次没有报错error,然后扔到tomcat里面启动没有错误日志了,访问也正常了!
谨以此文章记录提醒以后自己多关注一下项目执行、打包等过程和日志等!
总结
到此这篇关于Tomcat启动springboot项目war包报错:启动子级时出错的问题解决方案的文章就介绍到这了,更多相关Tomcat启动springboot项目war包报错内容请搜索毛票票以前的文章或继续浏览下面的相关文章希望大家以后多多支持毛票票!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。