为了账号安全,请及时绑定邮箱和手机立即绑定

jenkins打war包部署到tomcat解压启动失败。

jenkins打war包部署到tomcat解压启动失败。

RISEBY 2019-03-01 11:04:29
项目在jenkins中进行构建打包,之后部署到tomcat中解压运营,如果是tomcat中已存在该项目的情况下,一定会失败。并且如果把部署过来的war包在服务器上手动解压(windows服务器,使用解压缩工具比如WINRAR进行解压),项目就可以正常运行。查了一下log,在tomcat自动解压部署的war包并启动的时候会出现以下错误:java.io.IOException: Invalid argument at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428) at java.io.File.getCanonicalPath(File.java:618) at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:137) at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:619) at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:752) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:308) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:394) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:144) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:467) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1612) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1451) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:724) at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:423) at javax.servlet.http.HttpServlet.service(HttpServlet.java:651) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 查了很久一直找不到问题。求大神解答~
查看完整描述

3 回答

?
慕哥6287543

TA贡献1831条经验 获得超10个赞

提供有价值的信息太少,不好判断。
建议使用Deploy to container Plugin插件来发布war包。

查看完整回答
反对 回复 2019-03-01
?
肥皂起泡泡

TA贡献1829条经验 获得超6个赞

是不是你在Jenkins打包的时候缺少东西,我怀疑是你的包存在问题,你可以copy下来,对比一下本地的包

查看完整回答
反对 回复 2019-03-01
?
森林海

TA贡献2011条经验 获得超2个赞

我也遇到了这个问题,但是奇怪得是,不是每个项目都会这样,目前我有tomcat6得项目,是正常的,tomcat8的就有问题,不知道是否与jdk有关系,楼主解决这个问题了么?

楼主你好:现对此问题进行回复补充,经过十多个小时的努力,本人已经解决这个问题,此类问题应该是由于linux和window编码格式不一致导致的,通常伴有中文问题,排查方式如下,把需要部署的war包,在目标部署服务器上使用jar -xvf命令进行解压,解压过程中应该会提示错误,错误的那个文件或者目录,应该就是需要修改的文件名称或者路径。

查看完整回答
反对 回复 2019-03-01
  • 3 回答
  • 0 关注
  • 1298 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信