rancher 2.4.3部署tomcat的war包

1、开发同事给一个war包,然后从rancher UI界面进行部署,发现无法正常访问

2、起初怀疑是开发问题,同事debug一段时间后,发现项目并无问题

3、直接使用docker run起来的项目是正常,且也可以正常访问

4、放到物理机测试环境,也是正常。



报错日志大致如下,请大佬们帮忙分析分析,也请教过同事,但问题没有定性



2020-07-13 01:07:06.402 [localhost-startStop-1] ERROR o.s.b.d.LoggingFailureAnalysisReporter - [report,40] -
 
***************************
APPLICATION FAILED TO START
***************************
 
Description:
 
An attempt was made to call a method that does not exist. The attempt was made from the following location:
 
    org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactoryCustomizer.customizeRemoteIpValve(TomcatWebServerFactoryCustomizer.java:189)
 
The following method did not exist:
 
    org.apache.catalina.valves.RemoteIpValve.setHostHeader(Ljava/lang/String;)V
 
The method's class, org.apache.catalina.valves.RemoteIpValve, is available from the following locations:
 
    jar:file:/usr/local/tomcat/lib/catalina.jar!/org/apache/catalina/valves/RemoteIpValve.class
 
It was loaded from the following location:
 
    file:/usr/local/tomcat/lib/catalina.jar
 
 
Action:
 
Correct the classpath of your application so that it contains a single, compatible version of org.apache.catalina.valves.RemoteIpValve
 
13-Jul-2020 01:07:06.403 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/wopiserver]]
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:980)
  at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1851)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)
 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatServletWebServerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.apache.catalina.valves.RemoteIpValve.setHostHeader(Ljava/lang/String;)V
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
  at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
  at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
  at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152)
  at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132)
  at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92)
  at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5225)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  ... 10 more
 Caused by: java.lang.NoSuchMethodError: org.apache.catalina.valves.RemoteIpValve.setHostHeader(Ljava/lang/String;)V
  at org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactoryCustomizer.customizeRemoteIpValve(TomcatWebServerFactoryCustomizer.java:189)
  at org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactoryCustomizer.customize(TomcatWebServerFactoryCustomizer.java:85)
  at org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactoryCustomizer.customize(TomcatWebServerFactoryCustomizer.java:60)
  at org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor.lambda$postProcessBeforeInitialization$0(WebServerFactoryCustomizerBeanPostProcessor.java:72)
  at org.springframework.boot.util.LambdaSafe$Callbacks.lambda$null$0(LambdaSafe.java:287)
  at org.springframework.boot.util.LambdaSafe$LambdaSafeCallback.invoke(LambdaSafe.java:159)
  at org.springframework.boot.util.LambdaSafe$Callbacks.lambda$invoke$1(LambdaSafe.java:286)
  at java.util.ArrayList.forEach(ArrayList.java:1257)
  at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
  at org.springframework.boot.util.LambdaSafe$Callbacks.invoke(LambdaSafe.java:286)
  at org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor.postProcessBeforeInitialization(WebServerFactoryCustomizerBeanPostProcessor.java:72)
  at org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor.postProcessBeforeInitialization(WebServerFactoryCustomizerBeanPostProcessor.java:58)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
  ... 28 more
13-Jul-2020 01:07:06.404 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/local/tomcat/webapps/wopiserver.war]
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/wopiserver]]
  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:980)
  at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1851)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)

已邀请:

要回复问题请先登录注册