Tomcat no se limita a las opciones SNMP

Tomcat no se limita a las opciones SNMP

Tenemos una aplicación de monitoreo que usa SNMP, habilité SNMP en mi servidor Tomcat con la siguiente opción en bin/setenv.shel archivo.

#
# SNMP for Tomcat
#
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.interface=10.101.21.31"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.port=1651"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.snmp.acl=false"

Al iniciar Tomcat, no hay ningún problema, todo está limpio. pero cuando detengo Tomcat aparece este error.

[tomcat@webserver1 bin]$ ./catalina.sh stop
JAVA_OPTS: %JAVA_OPTS%
Using CATALINA_BASE:   /opt/tomcat7.1
Using CATALINA_HOME:   /opt/tomcat7.1
Using CATALINA_TMPDIR: /opt/tomcat7.1/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/tomcat7.1/bin/bootstrap.jar:/opt/tomcat7.1/bin/tomcat-juli.jar
Error: Failed to start SNMP adaptor with address: /10.101.21.31:1651 (Address already in use)

De todos modos, ¿puedo detener limpiamente a Tomcat en lugar de matarlo?

Respuesta1

Deberías usar CATALINA_OPTSen lugar de JAVA_OPTS. El catalina.shguión documenta bastante bien la diferencia:

#   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
#                   "run" or "debug" command is executed.
#                   Include here and not in JAVA_OPTS all options, that should
#                   only be used by Tomcat itself, not by the stop process,
#                   the version command etc.
#                   Examples are heap size, GC logging, JMX ports etc.

El hecho de que JAVA_OPTSesté configurado en %JAVA_OPTS%también indica que hay algo mal (probablemente un script escrito por un administrador de win32).

información relacionada