Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have an monitoring application using SNMP, I have enable SNMP in my tomcat server with following option in bin/ file.

# SNMP for Tomcat

At tomcat startup no issue at all everything is clean. but when i am stopping tomcat i am getting this error.

[tomcat@webserver1 bin]$ ./ stop
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: / (Address already in use)

Anyway i can cleanly stop tomcat rather than kill it?

share|improve this question

migrated from Oct 16 '12 at 0:27

This question came from our site for professional and enthusiast programmers.

You need to avoid setting the SNMP options on the JVM for the shutdown process. – bmargulies Oct 15 '12 at 20:53
up vote 4 down vote accepted

You should be using CATALINA_OPTS instead of JAVA_OPTS. The script documents the difference quite well:

#   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.

The fact that JAVA_OPTS is set to %JAVA_OPTS% also indicates that you have something wrong (probably a script that's been written by a win32 admin).

share|improve this answer
Epic!!! Win, Thanks! – Satish Oct 16 '12 at 14:07
This does not work on SLES 11 SP3 where the tomcat init script uses both CATALINA_OPTS and JAVA_OPTS for stop and start. – L.R. Jul 11 '14 at 9:43
If SLES uses CATALINA_OPTS for Tomcat start then they have made a mistake: you should file a bug report. – Christopher Schultz Jul 11 '14 at 15:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.