Страницы

Поиск по вопросам

пятница, 14 февраля 2020 г.

После перезагрузки сервера Tomcat приложения не запускаются до передеплоя

#tomcat #centos #развертывание


На севере CentOS установлен сервер приложений Tomcat. В нем развернут проект в корневой
папке webapps/ROOT как описано здесь: Tomcat 9 deploy into ROOT

После физической перезагрузки сервера поднимается служба Tomcat, но приложение в
корневой папке webapps/ROOT остается недоступно.

Если заново скопировать {name-of-the-app}.war в папку myapps, то Tomcat заново разворачивает
архив, и приложение становится доступно.



На сколько я понимаю, приложения должны подниматься вместе с Tomcat-ом, но почему-то
этого не происходит.

Что я делаю не так?



UPD: - Логи сервера приложений

catalina.out - после перезапуска сервера

13-Sep-2018 22:09:11.152 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Server version:        Apache Tomcat/9.0.12
13-Sep-2018 22:09:11.155 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Server built:          Sep 4 2018 22:13:41 UTC
13-Sep-2018 22:09:11.155 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Server number:         9.0.12.0
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
OS Name:               Linux
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
OS Version:            3.10.0-862.11.6.el7.x86_64
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Architecture:          amd64
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Java Home:             /usr/java/jdk1.8.0_181-amd64/jre
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
JVM Version:           1.8.0_181-b13
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
JVM Vendor:            Oracle Corporation
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
CATALINA_BASE:         /opt/apache-tomcat-9.0.12
13-Sep-2018 22:09:11.156 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
CATALINA_HOME:         /opt/apache-tomcat-9.0.12
13-Sep-2018 22:09:11.157 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
13-Sep-2018 22:09:11.159 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
13-Sep-2018 22:09:11.159 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Djava.library.path=/usr/local/apr/lib
13-Sep-2018 22:09:11.159 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
13-Sep-2018 22:09:11.159 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
13-Sep-2018 22:09:11.159 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
13-Sep-2018 22:09:11.159 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Dignore.endorsed.dirs=
13-Sep-2018 22:09:11.160 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Dcatalina.base=/opt/tomcat
13-Sep-2018 22:09:11.160 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Dcatalina.home=/opt/tomcat
13-Sep-2018 22:09:11.160 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log
Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
13-Sep-2018 22:09:11.160 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
Loaded APR based Apache Tomcat Native library [1.2.17] using APR version [1.4.8].
13-Sep-2018 22:09:11.160 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
13-Sep-2018 22:09:11.160 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent
APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
13-Sep-2018 22:09:11.166 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL
OpenSSL successfully initialized [OpenSSL 1.0.2k-fips  26 Jan 2017]
13-Sep-2018 22:09:11.338 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing
ProtocolHandler ["http-nio-8080"]
13-Sep-2018 22:09:11.355 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector
Using a shared selector for servlet write/read
13-Sep-2018 22:09:11.367 INFO [main] org.apache.coyote.http11.AbstractHttp11Protocol.configureUpgradeProtocol
The ["https-openssl-apr-8443"] connector has been configured to support negotiation
to [h2] via ALPN
13-Sep-2018 22:09:11.367 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing
ProtocolHandler ["https-openssl-apr-8443"]
13-Sep-2018 22:09:11.428 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing
ProtocolHandler ["ajp-nio-8009"]
13-Sep-2018 22:09:11.429 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector
Using a shared selector for servlet write/read
13-Sep-2018 22:09:11.430 INFO [main] org.apache.catalina.startup.Catalina.load Initialization
processed in 902 ms
13-Sep-2018 22:09:11.476 INFO [main] org.apache.catalina.core.StandardService.startInternal
Starting service [Catalina]
13-Sep-2018 22:09:11.477 INFO [main] org.apache.catalina.core.StandardEngine.startInternal
Starting Servlet Engine: Apache Tomcat/9.0.12
13-Sep-2018 22:09:11.489 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor
Deploying deployment descriptor [/opt/apache-tomcat-9.0.12/conf/Catalina/localhost/ROOT.xml]
13-Sep-2018 22:09:11.517 WARNING [main] org.apache.catalina.startup.HostConfig.deployDescriptor
The path attribute with value [] in deployment descriptor [/opt/apache-tomcat-9.0.12/conf/Catalina/localhost/ROOT.xml]
has been ignored
13-Sep-2018 22:09:11.527 WARNING [main] org.apache.catalina.startup.HostConfig.deployDescriptor
Deployment of deployment descriptor [/opt/apache-tomcat-9.0.12/conf/Catalina/localhost/ROOT.xml]
with an external docBase means the directory [/opt/apache-tomcat-9.0.12/webapps/ROOT]
in the appBase will be ignored
13-Sep-2018 22:09:12.431 INFO [main] 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.


catalina.out - после передеплоя

13-Sep-2018 22:12:42.714 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom
Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [210,235]
milliseconds.
13-Sep-2018 22:12:42.786 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor
Deployment of deployment descriptor [/opt/apache-tomcat-9.0.12/conf/Catalina/localhost/ROOT.xml]
has finished in [211,297] ms
13-Sep-2018 22:12:42.792 INFO [main] org.apache.coyote.AbstractProtocol.start Starting
ProtocolHandler ["http-nio-8080"]
13-Sep-2018 22:12:42.804 INFO [main] org.apache.coyote.AbstractProtocol.start Starting
ProtocolHandler ["https-openssl-apr-8443"]
13-Sep-2018 22:12:42.815 INFO [main] org.apache.coyote.AbstractProtocol.start Starting
ProtocolHandler ["ajp-nio-8009"]
13-Sep-2018 22:12:42.825 INFO [main] org.apache.catalina.startup.Catalina.start Server
startup in 211395 ms
13-Sep-2018 22:12:52.791 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.startup.HostConfig.reload Reloading context []
13-Sep-2018 22:12:52.794 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.core.StandardContext.reload Reloading Context with name [] has started
13-Sep-2018 22:12:53.966 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
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.
13-Sep-2018 22:12:53.994 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.core.StandardContext.reload Reloading Context with name [] is completed

    


Ответы

Ответ 1



Как выяснилось, Tomcat на самом деле запускался и поднимал приложение, но делал это очень медленно, а передеплой просто ускорял этот процесс. В некоторых случаях загрузка Tomcat вместе со всеми приложениями может длиться ~17 МИНУТ Проблема связана с ошибкой JDK-4705093 при генерации SecureRandom для SHA1PRNG. // Неочевидно, правда.. !! Но такое тоже бывает.. Решение: Открываем файл $JAVA_PATH/jre/lib/security/java.security Находим строку securerandom.source=file:/dev/random Заменяем ее на строку securerandom.source=file:/dev/./urandom Дополнительно: Более подробное описание ошибки можно найти здесь: Tomcat 7 starts too late on Ubuntu 14.04 x64 | stackoverflow.com

Комментариев нет:

Отправить комментарий