简体   繁体   中英

ubuntu tomcat8 won't start

I installed tomcat8 on Ubuntu 15.10 and it worked the first time. But then after I restarted it, it stopped working. Re-installing doesn't work.

apt-get install tomcat8 tomcat8-common tomcat8-user
# ... verified working for the whole day
service tomcat8 stop 
service tomcat8 start
# http://localhost:8080/ would hang forever

At the beginning, it appears that the problem was due to the installed default ROOT web app has the wrong context path

<Context path="/" antiResourceLocking="false" />

After I changed the path to "", tomcat no longer complaint about it. But still it does not respond. The installed files look similar to many other tomcat installation I've seen.

The log shows

    WARNING: Problem with directory [/usr/share/tomcat8/common/classes], exists: [false], isDirectory: [false], canRead: [false]
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
    WARNING: Problem with directory [/usr/share/tomcat8/common], exists: [false], isDirectory: [false], canRead: [false]
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
    WARNING: Problem with directory [/usr/share/tomcat8/server/classes], exists: [false], isDirectory: [false], canRead: [false]
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
    WARNING: Problem with directory [/usr/share/tomcat8/server], exists: [false], isDirectory: [false], canRead: [false]
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
    WARNING: Problem with directory [/usr/share/tomcat8/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.ClassLoaderFactory validateFile
    WARNING: Problem with directory [/usr/share/tomcat8/shared], exists: [false], isDirectory: [false], canRead: [false]
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server version:        Apache Tomcat/8.0.26 (Ubuntu)
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server built:          Aug 23 2015 22:30:40 UTC
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Server number:         8.0.26.0
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: OS Name:               Linux
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: OS Version:            3.16.0-23-generic
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Architecture:          amd64
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Java Home:             /usr/lib/jvm/java-8-openjdk-amd64/jre
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Version:           1.8.0_91-8u91-b14-0ubuntu4~15.10.1-b14
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: JVM Vendor:            Oracle Corporation
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_BASE:         /var/lib/tomcat8
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: CATALINA_HOME:         /usr/share/tomcat8
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.util.logging.config.file=/var/lib/tomcat8/conf/logging.properties
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.awt.headless=true
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Xmx128m
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -XX:+UseConcMarkSweepGC
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.endorsed.dirs=/usr/share/tomcat8/endorsed
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.base=/var/lib/tomcat8
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Dcatalina.home=/usr/share/tomcat8
May 19, 2016 2:20:31 PM org.apache.catalina.startup.VersionLoggerListener log
    INFO: Command line argument: -Djava.io.tmpdir=/tmp/tomcat8-tomcat8-tmp
    May 19, 2016 2:20:31 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-nio-8080"]
    May 19, 2016 2:20:31 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
    INFO: Using a shared selector for servlet write/read
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 505 ms
    May 19, 2016 2:20:31 PM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    May 19, 2016 2:20:31 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/8.0.26 (Ubuntu)
    May 19, 2016 2:20:31 PM org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory /var/lib/tomcat8/webapps/ROOT
    May 19, 2016 2:20:32 PM org.apache.jasper.servlet.TldScanner scanJars
    INFO: 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.

What could go wrong?

It turns out the server eventually started but it took really long time when it tries to create a SecureRandom instance. I will post a different for that problem.

May 19, 2016 2:48:22 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: 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.
May 19, 2016 3:21:37 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,994,925] milliseconds.
May 19, 2016 3:21:37 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 1,995,782 ms
May 19, 2016 3:21:37 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
May 19, 2016 3:21:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1995884 ms

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM