Service tomcat8 failed to start by using service tomcat8 start

后端 未结 4 1856
粉色の甜心
粉色の甜心 2021-02-14 20:19

I\'m using Vagrant to deploy to Ubuntu Linux and try to start a tomcat8 service.

Tomcat 8 was installed by apt-get install tomcat8.

Wh

相关标签:
4条回答
  • 2021-02-14 20:56

    What I did to solve the issue :

    Process: 1312 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=1/FAILURE)

    See tomcat's dependencies
    dpkg -s tomcat8-common|grep Depends

    and the system java version
    javar -version

    And try to sort out things with the appropriate java version if things don't match.


    If that's not the case, continue :

    Never bad to start with
    sudo apt-get update

    Check eventual running tomcat processes
    ps aux | grep java

    Test the pid you're going to kill
    pgrep -f tomcat

    Targeted action
    sudo pkill -f tomcat

    Start removing by typing sudo apt-get remove tomcat8-tab.
    You might find :

    tomcat8-common tomcat8-user

    Complete remove with ( I don't know which of these below is the most appropriate to run )
    sudo apt-get purge tomcat8 or
    sudo apt-get --auto-remove purge tomcat8 or just
    sudo apt-get remove tomcat8

    You can also
    sudo apt-get autoremove

    Carefully sudo rm -r folders like

    • /var/lib/tomcat*
    • /usr/share/tomcat*
    • /etc/tomcat*

    Reboot
    sudo systemctl reboot

    When back on track install
    sudo apt-get install tomcat8

    Check how's going
    sudo systemctl status tomcat8.service
    sudo /usr/share/tomcat8/bin/version.sh

    Better ?

    0 讨论(0)
  • 2021-02-14 20:57

    Verify your tomcat8 configuration file in /etc/default/tomcat8. See if there are badly configured variables.

    For me, this error was caused by the following variables in my configuration file:

    -Djava.awt.headless=true -XX:+UseConcMarkSweepGC
    JAVA_OPTS="-Djava.awt.headless=true -Xss4m -Xmx2g -XX:+UseConcMarkSweepGC"
    

    I commented and it worked.

    0 讨论(0)
  • 2021-02-14 20:58

    This issue can be caused when the tomcat8 server runs under user tomcat8 and the catalina.out was created by root.

    To solve this, delete catalina.out and let tomcat8 recreate it.

    0 讨论(0)
  • 2021-02-14 21:10

    This could be related to this bug. Recent versions of Java deprecate the use of endorsed directories and fail if one is specified, but Tomcat8 specifies one even if it doesn't exist. Check the log in /var/log/tomcat8/ as suggested in the comments to your question to see whether this is indeed the source of your problem. If it is, you can either wait for the bug to be fixed or try the updated catalina.sh file suggested in the linked bug report.

    0 讨论(0)
提交回复
热议问题