Hi Daniel,
I tried your suggestion and while I think it is now acknowledging the existence 
of the management.properties file (Windows Service wouldn't start if I 
purposely misspelled 'managemenX.properties') but it doesn't seem to be 
actually working  (JMX can't connect).

What I did:

I created a copy of an existing logging.properties file already in the CONF 
folder, renamed it management.properties, and removed all contents of it and 
put in:

Dcom.sun.management.jmxremote
Dcom.sun.management.jmxremote.port=8008
Dcom.sun.management.jmxremote.authenticate=false
Dcom.sun.management.jmxremote.ssl=false
Djava.rmi.server.hostname=<my host machine IP address>

And then in the Tomcat7w GUI under the Java tab I added it (last line)

-Dcatalina.home=C:\ <my folder structure>\Tomcat
-Dcatalina.base=C:\ <my folder structure>\Tomcat
-Djava.endorsed.dirs=C:\ <my folder structure>\Tomcat\endorsed
-Djava.io.tmpdir=C:\ <my folder structure>\Tomcat\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\ <my folder 
structure>\Tomcat\conf\logging.properties
-Dcom.sun.management.config.file= C:\ <my folder 
structure>\Tomcat\conf\management.properties    <============== new line

But it didn't connect through when opening  up jconsole.exe under C:\Program 
Files\Java\jdk1.7.0_80\bin and I didn't see the PORT being used when I did 
NETSTAT.  Note that I did an ECHO %CATALINA_OPTS% to make sure it wasn't hiding 
somewhere and nothing was returned

Finally, just to confirm that my parameters in the management.properties file 
were correct I add in the contents of it back into the Tomcat7w GUI under the 
Java tab like I had originally set up (JMX does now work BUT my original 
problem of not being able to stop the Service cleanly returns)

-Dcatalina.home=C:\ <my folder structure>\Tomcat
-Dcatalina.base=C:\ <my folder structure>\Tomcat
-Djava.endorsed.dirs=C:\ <my folder structure>\Tomcat\endorsed
-Djava.io.tmpdir=C:\ <my folder structure>\Tomcat\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\ <my folder 
structure>\Tomcat\conf\logging.properties
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8008
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=<my host machine IP address>

Did I miss something in your instructions?

Thanks, Louis

-----Original Message-----
From: Daniel Savard [mailto:daniel.sav...@gmail.com]
Sent: Thursday, August 02, 2018 6:15 PM
To: Tomcat Users List
Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat using a 
Windows Service in Tomcat 7.0.54

- - - external message, proceed with caution - - -


In ${Tomcat}/conf create the file management.properties and put your stuff
in this file like:

com.sun.management.jmxremote = true
com.sun.management.jmxremote.port = 9876
com.sun.management.registry.ssl =true
com.sun.management.ssl = true
com.sun.management.ssl.enebled.protocols = TLSv1.2
...

Then, remove your stuff from the CATALINA_OPTS and just point to this file
with
-Dcom.sun.management.config.file=${CATALINA_BASE}/conf/management.properties
and you port in use message will disappear since this configuration will be
handled properly.

Regards,

Le 2 août 2018 3:58 PM, "Louis Zipes" <louis.zi...@gmcr.com> a écrit :

Hi All,
I'm trying to enable JMX monitoring using Tomcat 7.0.54.  Turning on the
JMX monitoring is not the problem. To do this I added the following to the
Apache Tomcat 7.0 Properties 'JAVA' tab  GUI Window, which opens up when
you run 'TOMCAT7w.exe //ES/<service name>', and it works in that JMX can
monitor it.

-Djava.rmi.server.hostname=localhost
-Dcom.sun.management.jmxremote.port=8555
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=<hostname>


The problem is that when I go to STOP the Service it gives me the following
error

Error: Exception thrown by the agent : java.rmi.server.ExportException:
Port already in use: 8555; nested exception is:
               java.net.BindException: Address already in use: JVM_Bind


I have to do a hard kill by either restarting the Appserver or doing SC
QUERY which is not realistic

I can find hits on the error message but the answers seem to relate to the
need to set up JMX under CATALINA_OPTS.  My issue is that I'm struggling to
figure out how to set up CATALINA_OPTS that in Windows when starting Tomcat
using a Service.  The solutions I find either are Linux (I'm Windows) or
talks about setting up JMX with a setenv.bat OR catalina.bat files.
However, from my research the catalina.bat and setenv files are ignored
when you use a Windows Service.

So my question is how do I do I set up CATALINA_OPTS parameter in Tomcat
7.0.54 when I'm using a Windows Service?

Thanks, Louis

---------------------------------------
CONFIDENTIALITY NOTICE: This message is for intended addressee(s) only and
may contain information that is confidential, proprietary or exempt from
disclosure. If you are not the intended recipient, please contact the
sender immediately. Unauthorized use or distribution is prohibited and may
be unlawful.
---------------------------------------
CONFIDENTIALITY NOTICE: This message is for intended addressee(s) only and may 
contain information that is confidential, proprietary or exempt from 
disclosure. If you are not the intended recipient, please contact the sender 
immediately. Unauthorized use or distribution is prohibited and may be unlawful.

Reply via email to