On 09/08/18 12:11, Suvendu Sekhar Mondal wrote: > On Thu, Aug 9, 2018 at 2:39 PM Mark Thomas <ma...@apache.org> wrote: >> >> On 09/08/18 01:06, Daniel Savard wrote: >> >>> Louis, >>> >>> I believe you need to understand a bit more how things are working with >>> Java and the JVM. >> >> Actually Daniel, it is you who needs to understand things better. >> >> >> Louis, >> >> Clearly, when Tomcat is started a new JVM instance is created and it >> listens on the configured JMX ports. >> >> The problem is that when Tomcat is stopped another JVM instance is >> created (to send the stop message to the first) and that uses the same >> configuration. Hence it tries to open the same JMX port and fails >> because it is already bound. >> >> If you were running from the command line, the fix would be easy. Put >> the JMX options in CATALINA_OPTS and they'd only be used on start but >> not stop. (JAVA_OPTS are used on both start and stop). >> >> There is also a simple fix if running as a Windows Service. The Windows >> Service wrapper is simply a renamed version Apache Common Daemon. When >> running a Java program as a Windows service there are three ways it can >> be integrated. >> >> 1. jvm. The Windows service wrapper starts and embedded JVM using the >> provided parameters and then calls the start method on the appropriate >> class. To stop, it calls the stop method on the appropriate class in the >> embedded jvm. >> >> 2. Java. The Windows service wrapper starts a separate Java process with >> the provided parameters. On stop, a second Java process is started using >> the same parameters which is expected to communicate with the first >> process and stop it. >> >> 3. exe. Same as 2 but any executable can be used rather than java.exe. >> >> You see the error you are see because you are using Java mode. Switch to >> jvm mode and all should be well. >> >> Finally 7.0.54 is very old. I strongly recommend an upgrade at least to >> the latest 7.0.x release is not 8.5.x/9.0.x >> >> Mark >> > One question Mark, if I use > org.apache.catalina.mbeans.JmxRemoteLifecycleListener, would that work > as JVM mode or Java mode?
That would work in either mode of the Windows Service wrapper. If a second Java process is created to perform "stop", server.xml is parsed but only to read the shutdown port and command. Everything else is ignored. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org