Facing some issues regarding tomcat startup and shutdown on ubuntu 10.04

后端 未结 7 896
暖寄归人
暖寄归人 2021-02-03 23:16

I am facing some issues regarding tomcat startup and shutdown.

I am using

  1. Tomcat v.6.0.32 (using the extracted the bundle downloaded from Apache website a
相关标签:
7条回答
  • 2021-02-03 23:44

    In my scenario to this problem, there were some threads not successfully terminated with shutdown message posted to tomcat, which made tomcat process still hanging around.

    So I would start with plain tomcat instance..and keep adding the custom "wars" or changes one by one and make sure to stop tomcat successfully to narrow down the problem.

    0 讨论(0)
  • 2021-02-03 23:53

    Following command does the trick:

    service tomcat8 stop

    These ones would be helpful too:

    service tomcat8 start
    service tomcat8 restart
    0 讨论(0)
  • 2021-02-04 00:02

    Dont use /etc/bash.bashrc just put this on your catalina.sh

    After:

    if [ -r "$CATALINA_BASE"/bin/setenv.sh ]; then
                . "$CATALINA_BASE"/bin/setenv.sh
            elif [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
                . "$CATALINA_HOME"/bin/setenv.sh
            fi
    

    put this:

    export CATALINA_PID="$CATALINA_HOME/catalina_pid.txt"
    

    And now your tomcat will be killed when you use catalina.sh stop -force

    0 讨论(0)
  • 2021-02-04 00:02

    Solution; First set the pid of tomcat CATALINA_PID="/id.pid" export CATALINA_PID

    then kill it catalina.sh stop -force

    source: http://confluence.atlassian.com/pages/viewpage.action?pageId=216959212

    otherwise just as you mentioned, just kill it with the kill command

    ps aux | grep catalina
    kill <pid of tomcat>
    

    if the above two solutions don't fit your needs try the following:

    $ sudo service tomcat6 stop
    * Stopping Tomcat servlet engine tomcat6 [ OK ]
    $ sudo service tomcat6 start
    * Starting Tomcat servlet engine tomcat6 [ OK ]
    $
    

    or of course the more traditional way:

    $ sudo /etc/init.d/tomcat6 stop
    * Stopping Tomcat servlet engine tomcat6 [ OK ]
    $ sudo /etc/init.d/tomcat6 start
    * Starting Tomcat ser
    
    0 讨论(0)
  • 2021-02-04 00:07

    I think the officially recommended way (according to catalina.sh inline comments) is:

    • create a setenv.sh file under $CATALINA_HOME/bin:

    #!/bin/sh

    CATALINA_PID="$CATALINA_HOME/logs/catalina.pid"; export CATALINA_PID

    • chmod as executable:

      chmod u+x setenv.sh

    • create the pid file by:

      touch $CATALINA_HOME/logs/catalina.pid

    • then startup tomcat as usual, the pid file will be updated automatically. And you can stop tomcat by "-force" option as well.
    0 讨论(0)
  • 2021-02-04 00:08

    The problem is caused because the address you use to start tomcat (in normal or debug mode) is already taken by another process.

    You need to check the ports you are using in the you conf file (e.g. your_TOMCAT_HOME_DIR_/conf/server.xml), to see if they are not already used

    Here you can look at the port used for

    • starting Tomcat: default value 8080
    • stopping Tomcat: default value 8005
    • using with AJP protocoll: default value 8009

    and if you are using Tomcat in debug mode (through jdpa or jdwp ), please make sure to use a different port than all the previous configured ports

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