Hi Louis,

try the following format:

set CATALINA_OPTS="-Dcom.sun.management.conf.file=%CATALINA_BASE%\conf\abc.efg"

In the above, %CATALINA_BASE% is a bariable that should be resolved by Tomcat. If it is not, I made a mistake in the variable name, but I think it should work (you could also try %catalina.base%).

You put this to setenv.bat in your bin directory. If the setenv.bat file does not exist, create it. Note that you can also set your properties in CATALINA_OPTS directly, i.e. you'd delete the line above in setenv.bat and paste in:

set CATALINA_OPTS="-Dproperty1=value1 -Dproperty2=value2" etc. When you start Tomcat, it should read all the properties in CATALINA_OPTS and show you the properties at the beginning of the log.

Hope this helps.

On 08/08/2018 03:10 PM, Louis Zipes wrote:
Hi Daniel,
I apologize if maybe it is my lack of knowledge but I don't think I understand 
the actual way to write the line 'Set Catalina_Opts ='  in this management file 
that I'm going to reference in the Java window/tabe in the Tomcat 7w GUI.

In my management.properties file (in the /CONF folder which is where also the 
server.xml file sits) I have the following

com.sun.management.jmxremote
com.sun.management.jmxremote.port=8008
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
java.rmi.server.hostname=<host name>

How do I set these as my CATALINA_OPTS values?  I have tried various 'SET 
CATALINA_OPTS...' options but I can't seem to write it the correct way for 
Windows.  I have even tried to set the CATALINA_OPTS option, pointing to the 
management.properties file in the Java tab in the Tomcat7w GUI but I get an 
error that the Class can't be found so I must be writing it wrong.

Thanks for the continued assistance.

- Louis



-----Original Message-----
From: Daniel Savard [mailto:daniel.sav...@gmail.com]
Sent: Friday, August 03, 2018 11:57 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 - - -


Le ven. 3 août 2018 à 12:03, Louis Zipes <louis.zi...@gmcr.com> a écrit :

Good catch!!  I still had 'd' in front of my lines so once I removed those
JMX starts up using Management.properties file but as you mentioned it
doesn't really change the behavior at all and the Service still doesn't
stop cleanly.  So is there a way to force the JMX to use CATALINA_OPTS in
this file.  Something like SET CATALINA_OPTS = 'JMX settings'?

That is if the JMX running on CATALINA_OPTS is indeed the answer.
Basically, trying to mimic the setenv file that is not used by the Window
Service.

-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Friday, August 03, 2018 11:52 AM
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/3/18 11:32 AM, Louis Zipes wrote:
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:
Just FYI, there is nothing magical about an existing properties file.
It's just a text file with name=value items in it.

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>
I don't think you want those leading D characters. Is that a
copy/paste error?

-Dcom.sun.management.config.file= C:\ <my folder
structure>\Tomcat\conf\management.properties
Daniel usually knows what he's talking about, but I'll be surprised if
Tomcat doesn't fail the same way after making these changes... you are
just moving the configuration from one place (multiple system
properties) to another (one system property pointing to another file
of properties).

- -chris

As Christopher said, you this file management.properties can be named
whatever abc.efg would do the same and in that file you have
attribute=value pairs, everything that concerns the com.sun.management.xxx
properties. Then you pass the name of that file as a single option to the
JVM with -Dcom.sun.management.config.file=${catalina.base}/conf/abc.efg and
remove everything else from the CATALINA_OPTS which is in the configuration
file. I strongly suggest to locate this file in the same directory as the
server.xml file and use the ${catalina.base} variable asis and litterally
into the 
CATALINA_OPTS="-Dcom.sun.management.conf.file=${catalina.base}/conf/abc.efg"
definition.

I skipped other configuration files for authentication, in my case I am
authenticating the users against the Active Directory database. So, the
informations I gave for the content of the configuration file is incomplete
and do not necessarily apply to your case, that's why I didn't bother to
put it in my original post. But, you may have to use extra properties for
you particular situation.

Why did I say to put everything in the configuration file for
com.sun.management.config.file? Because that way, the JVM knows these are
for JMX and knows the port is for JMX and will not run into a nonesense
when stopping the service saying the port is already in use. That's why you
should put this into the configuration file and define the property to tell
the JVM the pathname of the configuration file.

Regards,
-----------------
Daniel Savard
---------------------------------------
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.

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


--

Marek Czernek

JWS/JBCS Associate Quality Engineer, RHCA

Find me at www.halfastack.com

Reply via email to