Why my war file still copied and extract but not running in tomcat docker container

huangapple go评论82阅读模式
英文:

Why my war file still copied and extract but not running in tomcat docker container

问题

我的 Dockerfile

FROM tomcat:8.0-alpine
ADD /out/artifacts/Satellite_war/ROOT.war /usr/local/tomcat/webapps/satellite.war
EXPOSE 8080
CMD ["catalina.sh", "run"]

之后,在我的基础项目文件夹中运行以下命令,成功构建了名为 satellite 的镜像:

docker build -t satellite .

然后我运行容器:

docker run -d -p 6969:8080 satellite

当我打开我的网页浏览器(地址为 http://localhost:6969)时,它会进入到 Tomcat 主页,http://localhost:6969/satellite 也无法工作。

但是,当我检查容器中的 Tomcat webapps 文件夹时,仍然有我的项目文件夹和 war 文件。

关于这个问题,你应该怎么做呢?

更新=======================

我的 Tomcat 日志

(此处省略了大部分日志内容,只保留了开头和结尾的部分)
英文:

My Dockerfile

 FROM tomcat:8.0-alpine 
 ADD /out/artifacts/Satellite_war/ROOT.war /usr/local/tomcat/webapps/satellite.war 
 EXPOSE 8080 
 CMD ["catalina.sh", "run"]

After that, i run this in my base project folder and it build image success with name satellite

docker build -t satellite .

Then i run the container

docker run -d -p 6969:8080 satellite

When i start my web browser (which is http://localhost:6969), it gone to tomcat home page Why my war file still copied and extract but not running in tomcat docker container, http://localhost:6969/satellite also not working

But when i check my tomcat webapps folder in my container, it still have the folder of my project and my war file

Why my war file still copied and extract but not running in tomcat docker container

What should i do?

Update=======================
My tomcat logs

    27-Oct-2020 00:58:03.407 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.53
27-Oct-2020 00:58:03.408 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 29 2018 14:42:45 UTC
27-Oct-2020 00:58:03.408 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.53.0
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.19.128-microsoft-standard
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-1.7-openjdk/jre
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.7.0_181-b01
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat
27-Oct-2020 00:58:03.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
27-Oct-2020 00:58:03.410 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
27-Oct-2020 00:58:03.410 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
27-Oct-2020 00:58:03.410 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
27-Oct-2020 00:58:03.410 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
27-Oct-2020 00:58:03.410 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
27-Oct-2020 00:58:03.410 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
27-Oct-2020 00:58:03.410 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
27-Oct-2020 00:58:03.411 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
27-Oct-2020 00:58:03.411 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.17 using APR version 1.6.3.
27-Oct-2020 00:58:03.411 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
27-Oct-2020 00:58:03.414 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2o 27 Mar 2018)
27-Oct-2020 00:58:03.514 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"]
27-Oct-2020 00:58:03.524 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"]
27-Oct-2020 00:58:03.526 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 667 ms
27-Oct-2020 00:58:03.562 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
27-Oct-2020 00:58:03.563 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.53
27-Oct-2020 00:58:03.590 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /usr/local/tomcat/webapps/satellite.war
27-Oct-2020 00:58:08.587 WARNING [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used.
27-Oct-2020 00:58:13.317 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
27-Oct-2020 00:58:14.447 INFO [localhost-startStop-1] com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.info Parsing configuration file [struts-default.xml]
27-Oct-2020 00:58:14.594 INFO [localhost-startStop-1] com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.info Parsing configuration file [struts-plugin.xml]
27-Oct-2020 00:58:14.657 INFO [localhost-startStop-1] com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.info Parsing configuration file [struts.xml]
27-Oct-2020 00:58:14.661 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory)
27-Oct-2020 00:58:14.661 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.FileManagerFactory)
27-Oct-2020 00:58:14.661 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.XWorkConverter)
27-Oct-2020 00:58:14.661 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.CollectionConverter)
27-Oct-2020 00:58:14.662 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.ArrayConverter)
27-Oct-2020 00:58:14.662 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.DateConverter)
27-Oct-2020 00:58:14.662 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.NumberConverter)
27-Oct-2020 00:58:14.662 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.StringConverter)
27-Oct-2020 00:58:14.662 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionFileProcessor)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterCreator)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterHolder)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.TextProvider)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.LocaleProvider)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.ActionProxyFactory)
27-Oct-2020 00:58:14.663 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer)
27-Oct-2020 00:58:14.664 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (org.apache.struts2.dispatcher.mapper.ActionMapper)
27-Oct-2020 00:58:14.664 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (jakarta) for (org.apache.struts2.dispatcher.multipart.MultiPartRequest)
27-Oct-2020 00:58:14.664 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (org.apache.struts2.views.freemarker.FreemarkerManager)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (org.apache.struts2.components.UrlRenderer)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.validator.ActionValidatorManager)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.util.ValueStackFactory)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionProvider)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.util.PatternMatcher)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (org.apache.struts2.dispatcher.StaticContentLoader)
27-Oct-2020 00:58:14.666 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.UnknownHandlerManager)
27-Oct-2020 00:58:14.667 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (org.apache.struts2.views.util.UrlHelper)
27-Oct-2020 00:58:14.667 INFO [localhost-startStop-1] org.apache.struts2.config.BeanSelectionProvider.info Choosing bean (struts) for (com.opensymphony.xwork2.util.TextParser)
27-Oct-2020 00:58:14.897 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file
27-Oct-2020 00:58:14.897 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/satellite] startup failed due to previous errors
27-Oct-2020 00:58:14.910 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /usr/local/tomcat/webapps/satellite.war has finished in 11,319 ms
27-Oct-2020 00:58:14.911 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/manager
27-Oct-2020 00:58:14.967 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/manager has finished in 56 ms
27-Oct-2020 00:58:14.967 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/examples
27-Oct-2020 00:58:15.231 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/examples has finished in 264 ms
27-Oct-2020 00:58:15.231 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/docs
27-Oct-2020 00:58:15.261 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/docs has finished in 30 ms
27-Oct-2020 00:58:15.261 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/ROOT
27-Oct-2020 00:58:15.286 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/ROOT has finished in 25 ms
27-Oct-2020 00:58:15.287 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/host-manager
27-Oct-2020 00:58:15.314 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/host-manager has finished in 27 ms
27-Oct-2020 00:58:15.327 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
27-Oct-2020 00:58:15.363 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
27-Oct-2020 00:58:15.396 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 11870 ms

答案1

得分: 1

>27-Oct-2020 00:58:14.897 严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal 一个或多个过滤器启动失败。完整细节将在相应的容器日志文件中找到。

>27-Oct-2020 00:58:14.897 严重 [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal 由于先前的错误,上下文[/satellite]的启动失败。

看起来satellite应用程序出现了问题。您有其他日志文件吗?

英文:

>27-Oct-2020 00:58:14.897 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file

>27-Oct-2020 00:58:14.897 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/satellite] startup failed due to previous errors

Looks like something is wrong with satellite application. Do you have other log files?

huangapple
  • 本文由 发表于 2020年10月27日 08:40:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/64546842.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定