温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Tomcat启动springboot项目war包报错怎么办

发布时间:2020-08-10 16:06:06 来源:亿速云 阅读:1084 作者:小新 栏目:开发技术

这篇文章主要介绍Tomcat启动springboot项目war包报错怎么办,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

java.lang.IllegalStateException: 启动子级时出错
  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: 初始化组件[org.apache.catalina.webresources.JarResourceSet@67d48005]失败。
  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

一直在关注:启动子级时出错,找了很久没有解决!后面关注到下面的zip错误问题,然后再回去考虑打包的问题,终于发现打包的时候出现了问题,虽然最后是build success,但是前面提示了有error没注意到,截图如下:

Tomcat启动springboot项目war包报错怎么办

这就是问题所在,怎么解决的呢?

解决方法:将报错的jar包从maven仓库中删除掉,然后重新下载打包,发现这一次没有报错error,然后扔到tomcat里面启动没有错误日志了,访问也正常了!

谨以此文章记录提醒以后自己多关注一下项目执行、打包等过程和日志等!

以上是Tomcat启动springboot项目war包报错怎么办的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI