【问题标题】:Not able to stop the tomcat server in linux无法在 linux 中停止 tomcat 服务器
【发布时间】:2016-10-31 20:27:49
【问题描述】:

我正在尝试通过 linux 命令停止 tomcat 服务器。

 ./catalina.sh stop

使用上述命令会给出以下错误消息:

Using CATALINA_BASE:   /opt/Arpita/arpita_apache-tomcat-7.0.47
Using CATALINA_HOME:   /opt/Arpita/arpita_apache-tomcat-7.0.47
Using CATALINA_TMPDIR: /opt/Arpita/arpita_apache-tomcat-7.0.47/temp
Using JRE_HOME:        /opt/./jdk1.7.0_01/
Using CLASSPATH:       /opt/Arpita/arpita_apache-tomcat-7.0.47/bin/bootstrap.jar:/opt/Arpita/arpita_apache-tomcat-7.0.47/bin/tomcat-juli.jar
Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:741]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
./catalina.sh: line 446: 22194 Aborted                 "/opt/./jdk1.7.0_01//bin/java" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=172.18.15.15 -XX:MaxPermSize=128M -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/root/ -Dchef.endpoint=https://172.19.24.112:443 -Daricloud.home=/opt/Arpita/properties -Duser.home=/opt/chef-repo -Duser.name=root -Duser.password=abc123 -Dchef.client=admin -Dchef.validator=chef-validator -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1889 -Xdebug -Xnoagent -Djava.compiler=NONE -Dguice.executor.class -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=1024m -Djava.endorsed.dirs="/opt/Arpita/arpita_apache-tomcat-7.0.47/endorsed" -classpath "/opt/Arpita/arpita_apache-tomcat-7.0.47/bin/bootstrap.jar:/opt/Arpita/arpita_apache-tomcat-7.0.47/bin/tomcat-juli.jar" -Dcatalina.base="/opt/Arpita/arpita_apache-tomcat-7.0.47" -Dcatalina.home="/opt/Arpita/arpita_apache-tomcat-7.0.47" -Djava.io.tmpdir="/opt/Arpita/arpita_apache-tomcat-7.0.47/temp" org.apache.catalina.startup.Bootstrap stop

我已经使用./catalina.sh stop 命令启动了服务器。

【问题讨论】:

    标签: linux tomcat server


    【解决方案1】:

    我找到了杀死服务器的方法,首先我找到了它的进程 ID 使用:ps -eaf | grep tomcat 然后使用它的 processId 杀死所需的进程:kill -9 *ID*

    【讨论】:

      【解决方案2】:

      您已向JAVA_OPTS 添加了一个或多个调试选项,因此脚本会尝试在startstop 期间使用它们。由于 Tomcat 运行时调试端口已在使用中,因此当您尝试调用 stop(这也启动 Java 进程)时会看到此故障。

      在几乎所有用例中,您都应该使用CATALINA_OPTS 而不是JAVA_OPTS

      此外,Tomcat 脚本包括对调试的支持。需要设置合适的环境变量(见catalina.sh开头的注释),然后用./catalina.sh jpda start启动Tomcat。

      最后,如果您想通过kill 停止Tomcat,请先尝试kill -15 <pid>,因为它会调用标准关闭过程,而不是kill -9 <pid>,后者不会执行完全关闭。

      【讨论】:

        猜你喜欢
        • 2018-01-20
        • 2013-02-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-01-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多