Tomcat7 si blocca sulla distribuzione di app


10

Sto avendo un comportamento molto strano in Tomcat 7 su Ubuntu 14.04.

Ho creato un nuovo VPS, installato default-jdk e altre cose semplici. Tomcat scaricato e decompresso 7. Controllato che funzioni [myIP]:8080e ha visualizzato la pagina indice di Tomcat.

Una volta riavviato il VPS, ho riavviato Tomcat e ... non c'è risposta [myIP]:8080. Neanche un errore. Quando ho controllato i registri, ho visto che Tomcat si blocca in stato di distribuzione sul primo webapp.

I miei registri :

Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.57
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Nov 3 2014 08:39:16 UTC
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.57.0
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Linux
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            3.13.0-37-generic
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME:             /usr/lib/jvm/java-7-openjdk-amd64/jre
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_65-b32
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         /opt/tomcat
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         /opt/tomcat
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/tomcat/endorsed
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/tomcat
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/tomcat
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
Dec 31, 2014 9:06:04 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Dec 31, 2014 9:06:04 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:06:04 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2327 ms
Dec 31, 2014 9:06:04 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 31, 2014 9:06:04 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Dec 31, 2014 9:06:04 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat/webapps/host-manager
Dec 31, 2014 9:11:09 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [303,104] milliseconds.
Dec 31, 2014 9:11:09 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/tomcat/webapps/host-manager has finished in 304,682 ms
Dec 31, 2014 9:11:09 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat/webapps/manager
Dec 31, 2014 9:11:09 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/tomcat/webapps/manager has finished in 271 ms
Dec 31, 2014 9:11:09 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat/webapps/docs
Dec 31, 2014 9:11:09 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/tomcat/webapps/docs has finished in 205 ms
Dec 31, 2014 9:11:09 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat/webapps/examples
Dec 31, 2014 9:11:11 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/tomcat/webapps/examples has finished in 1,422 ms
Dec 31, 2014 9:11:11 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat/webapps/ROOT
Dec 31, 2014 9:11:11 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /opt/tomcat/webapps/ROOT has finished in 177 ms
Dec 31, 2014 9:11:11 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:11:11 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:11:11 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 306957 ms
Dec 31, 2014 9:17:35 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:17:35 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:17:35 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Dec 31, 2014 9:17:36 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:17:36 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:17:36 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:17:36 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.57
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Nov 3 2014 08:39:16 UTC
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.57.0
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Linux
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            3.13.0-37-generic
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME:             /usr/lib/jvm/java-7-openjdk-amd64/jre
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_65-b32
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         /opt/tomcat
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         /opt/tomcat
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/tomcat/endorsed
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/tomcat
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/tomcat
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
Dec 31, 2014 9:20:01 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Dec 31, 2014 9:20:01 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:20:01 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:20:01 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1536 ms
Dec 31, 2014 9:20:02 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 31, 2014 9:20:02 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Dec 31, 2014 9:20:02 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat/webapps/host-manager
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.57
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Nov 3 2014 08:39:16 UTC
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.57.0
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Linux
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            3.13.0-37-generic
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME:             /usr/lib/jvm/java-7-openjdk-amd64/jre
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_65-b32
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         /opt/tomcat
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         /opt/tomcat
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/tomcat/endorsed
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/tomcat
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/tomcat
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
Dec 31, 2014 9:33:38 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
Dec 31, 2014 9:33:38 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Dec 31, 2014 9:33:38 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 31, 2014 9:33:38 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2495 ms
Dec 31, 2014 9:33:39 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 31, 2014 9:33:39 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Dec 31, 2014 9:33:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat/webapps/host-manager

Fino alla linea 74, si tratta di un normale avvio del server. Sono state distribuite tutte le webapp standard (linee 48-68), ma dopo si blocca. Quindi, ho fermato il server e riavviato il mio sistema. Ha ricominciato Tomcat e inizia il miracolo. La sessione successiva è nelle righe 89-136 e puoi vedere che non ci sono voci per Server startup in xxxx ms.

Si blocca solo nella distribuzione e questa situazione si ripete continuamente. Che cosa potrebbe causare questo? Ho passato ore a lottare con questo problema e impazzisco e non vado da nessuna parte.


Ho trovato una buona decisione qui. Dobbiamo aggiornare il generatore casuale di demoni, che supporterà il sistema operativo con enthropy. stackoverflow.com/questions/27612209/...
Asprelis

Risposte:


22

Un possibile problema è Tomcat in attesa di accumulo di entropia. Prendi un po 'di discarica con jstackper vedere chi sta aspettando cosa.

Tomcat 7+ si affida fortemente alla SecureRandomclasse per fornire valori casuali per i suoi ID di sessione e altre cose. A seconda del JRE, può causare ritardi durante l'avvio se la sorgente di entropia utilizzata per inizializzare SecureRandomè a corto di entropia.

Se il problema è l'entropia, esiste un modo per configurare JRE in modo che utilizzi un'origine entropia non bloccante impostando la seguente proprietà di sistema:

-Djava.security.egd=file:/dev/./urandom

Vedi questa discussione correlata per maggiori dettagli .


INFORMAZIONI: La creazione dell'istanza SecureRandom per la generazione dell'ID sessione mediante [SHA1PRNG] ha richiesto [4.118.269] millisecondi. Sembra che tu abbia ragione. Proverò a cambiare la fonte dell'entropia
Asprelis il

Oh dio grazie per il suggerimento !!! Sono turbato da questo problema per circa 2 giorni!
Rugal,

Una soluzione alternativa è l'installazione di havegedfeed / dev / random con entropia, vedi digitalocean.com/community/tutorials/…
James,

1
@James sì, certo, ma devi fare attenzione ai dettagli security.stackexchange.com/questions/34523/…
Federico Sierra,

0

Può essere utile per qualcuno:

Verifica di non avere tali dipendenze nel tuo pom.xml:

    <dependency>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-catalina</artifactId>
        <version>8.0.23</version>
    </dependency>

Potresti spiegare perché? Ho tali dipendenze in uno dei miei progetti. e tutto sembra a posto.
Asprelis,

0

Una possibile causa del problema: un errore di battitura nel percorso del file keystore:

keystoreFile="conf/cert/certificate.ks"

questo potrebbe effettivamente accadere e potresti trascurare l'errore durante il processo di caricamento del server
hello_earth
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.