$sudo -u etl ./bin/shutdown.sh
Using CATALINA_BASE: /opt/apache-tomcat-6.0.20
Using CATALINA_HOME: /opt/apache-tomcat-6.0.20
Using CATALINA_TMPDIR: /opt/apache-tomcat-6.0.20/temp
Using JRE_HOME: /usr/java/jre1.6.0_14/
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 9004; nested exception is:
java.net.BindException: Address already in use
找了下,server.xml里没有监听这个端口,什么进程监听的?但是netstat看到的PID还就是这个tomcat的PID
$ sudo netstat -lantup|grep :9004
tcp 0 0 :::9004 :::* LISTEN 30707/java
$ ps aux|grep java
etl
30707 1.3 7.4 1663876 604948 ? Sl 23:10 0:37 /usr/java/jdk/bin/java -Djava.util.logging.config.file=/opt/apache-tomcat-6.0.20/conf/logging.properties -Xms512m -Xmx1024m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -XX:PermSize=100M -XX:MaxPermSize=200m -Djava.endorsed.dirs=/opt/apache-tomcat-6.0.20/endorsed -classpath :/opt/apache-tomcat-6.0.20/bin/bootstrap.jar -Dcatalina.base=/opt/apache-tomcat-6.0.20 -Dcatalina.home=/opt/apache-tomcat-6.0.20 -Djava.io.tmpdir=/opt/apache-tomcat-6.0.20/temp org.apache.catalina.startup.Bootstrap start
etl 31530 0.0 6.4 1595812 525508 pts/3 Sl 10:41 0:42 /usr/java/jdk/bin/java -Dprogram.name=run.sh -server -Xms1024m -Xmx1024m -Xss128k -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:MaxTenuringThreshold=6 -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:PermSize=96m -XX:MaxPermSize=128m -Dsun.jnu.encoding=GBK -Dfile.encoding=GBK -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/opt/jboss-4.2.2.GA/lib/endorsed -classpath /opt/jboss-4.2.2.GA/bin/run.jar:/usr/java/jdk/lib/tools.jar org.jboss.Main
52683 32648 0.0 0.0 63408 784 pts/5 S+ 23:57 0:00 grep java
bin/catalina.sh:JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
是一个jconsole远程监控端口.
Unix/Linux平台:修改catalina.sh,在"run"和"start"段开头增加一行(注意是一行):
JAVA_OPTS="$JAVA_OPTS "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port="9004" -Dcom.sun.management.jmxremote.authenticate="false" -Dcom.sun.management.jmxremote.ssl="false"
或者换成CATALINA_OPTS?看catalina.sh脚本中的说明:
# CATALINA_OPTS (Optional) Java runtime options used when the "start",
# or "run" command is executed.
# JAVA_OPTS (Optional) Java runtime options used when the "start",
# "stop", or "run" command is executed.
既然不想要在stop时检查这个变量,CATALINA_OPTS不正符合要求?
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
http://qify.iteye.com/blog/464123
http://hi.baidu.com/gestapo8/blog/item/d4c2591e3f0b52fa1bd5767b.html
阅读(2341) | 评论(0) | 转发(0) |