Thanks for the response

>When you say "stop the service" you just mean clicking the "stop service" link 
>in the management snap-in, right?

Correct

>1. You only have a single Tomcat service defined.
>2. It starts up just fine.
> 3. It only fails when trying to stop it.

Correct

> Do you have any opportunities for upgrading to 7.0.latest?

I have a sandbox where I can try that but it might cause issues with the 
application I'm running with Tomcat.  I will try to try this within the next 
week and let you know.



-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Thursday, August 02, 2018 5:04 PM
To: users@tomcat.apache.org
Subject: Re: Question about setting CATALINA_OPTS when starting Tomcat using a 
Windows Service in Tomcat 7.0.54

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Louis,

On 8/2/18 3:58 PM, Louis Zipes wrote:
> 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>

Congratulations on getting that working. Sometimes it can be a pain to
get JMX working.

FWIW, I always recommend using the JMX Proxy Servlet[1] because (a)
you don't have to set up a remote-JMX port and (b) deal with the poor
authentication support and (c) launch a whole JVM process just to take
a quick sample.

> 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

Yuck.

When you say "stop the service" you just mean clicking the "stop
service" link in the management snap-in, right?

Hrm.

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

Yeah, that's usually because someone is using the scripts like
catalina.sh (*NIX) or catalina.bat to launch (and stop) Tomcat and
they have used JAVA_OPTS (which are applied to all JVM launches) to
set those options instead of CATALINA_OPTS (which only applies to
starting Tomcat, not to stopping it, etc.).

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

Ignore all that. When using the service, the environment variables are
not relevant (after creating the 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.
Exactly.

> 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?

I'm surprised it's failing at all, honestly.

Can you confirm the following:

1. You only have a single Tomcat service defined.
2. It starts up just fine.
3. It only fails when trying to stop it.

Do you have any opportunities for upgrading to 7.0.latest?

- -chris

[1]
http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html#Using_the_JMXPro
xyServlet
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAltjcd0ACgkQHPApP6U8
pFis3g/+Ll/6m4VYpII6IFgJF+weoMn9EZ/3E9zbmN/00b63l2uKgNL9rX5eFRXH
v+8Mt9HLRy3ve+UXQsCE3dbm0Uw974ujjht6HrTr3dt4uTY6pGU1XtJqxUL4aFXF
Ri1xL3CwbO8+lGMNsd7zW80kf9wvcyqDt2NfXKz50Y/EkjiFjPYwVbyO2qWjORx9
JdUGBY7GCyk6E9f/UeEJq1JAWRqX2DAdwOn9l8EQ7ECYpXNyd6Jp7gxO/sIpuEpL
NuyRjIjrqyD/7ob65rTEjhXkWarZi5R88RMPmBJ2sHm+mefZQu1sVjJ47sU6emM4
eTAZVgB8RPdtHwjE2+rfezSnKk0969xF8rvI6ehkbaCJ+0qXNYwcqu2lbRhZrPv/
wMNSBj03NToglihLUfmKDraweH3LBvsUdLDLm/mUZoR44l7pjE55o8fc7bT7rJSM
1lFkPOPlXlWtbNrjIMXdLIaJU4fAh8StwQbIdg9Fxku4k9uo7+kT+w52tFVzGq6u
dlKKG/uYIzmkSbJQBK/C1q4wy7hgi3s3kd5KnymRAXeBva9tPkbUkKlAvNdQVfxN
f5RHdECFF6vL5lLNgcDAHNwRPsQJ2G7nPDdGuoBpf6hQR30jUN7l0nTv/CYYVZY1
0DWlxaVr+/mboIGwOTrB602qKif5FYSuf3WuoogHSuRAueBjBmM=
=gT8A
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

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