You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "James H. H. Lampert" <ja...@touchtonecorp.com> on 2016/09/01 18:36:08 UTC
AT WITS END regarding JVM arguments
Ladies and Gentlemen:
One of our Tomcat servers (refreshed from
apache-tomcat-7.0.67-windows-x86.zip) is running AS A SERVICE on a
Windows box.
And we need to set JVM Options of
-Djavax.servlet.request.encoding=UTF-8
-Dfile.encoding=UTF-8
-Djava.awt.headless=true
Unlike IBM Midrange boxes, on which I can, with a simple OS command,
list all the JVMs currently running on the system, and look up the
arguments, environment variables, system properties, &c, I can't find
any way to verify the JVM arguments (this box has only a JRE, not a
JDK), other than what gets sent to the log file. I even tried installing
a trial of JProfiler, but if checking arguments is in there, it's
well-hidden!
I just tried adding a "setenv.bat" to the "bin" directory, containing
> SET CATALINA_OPTS=-Djava.awt.headless=true -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
and after stopping and starting the service, even after rebooting the
Windows box, "headless" cannot be found in the log file, and neither can
I find "UTF."
WHAT COULD BE GOING WRONG HERE?
--
JHHL
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by Mark Eggers <it...@yahoo.com.INVALID>.
James,
On 9/1/2016 11:36 AM, James H. H. Lampert wrote:
> Ladies and Gentlemen:
>
> One of our Tomcat servers (refreshed from
> apache-tomcat-7.0.67-windows-x86.zip) is running AS A SERVICE on a
> Windows box.
>
> And we need to set JVM Options of
> -Djavax.servlet.request.encoding=UTF-8
> -Dfile.encoding=UTF-8
> -Djava.awt.headless=true
>
> Unlike IBM Midrange boxes, on which I can, with a simple OS command,
> list all the JVMs currently running on the system, and look up the
> arguments, environment variables, system properties, &c, I can't find
> any way to verify the JVM arguments (this box has only a JRE, not a
> JDK), other than what gets sent to the log file. I even tried installing
> a trial of JProfiler, but if checking arguments is in there, it's
> well-hidden!
>
> I just tried adding a "setenv.bat" to the "bin" directory, containing
>
>> SET CATALINA_OPTS=-Djava.awt.headless=true
>> -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
>
> and after stopping and starting the service, even after rebooting the
> Windows box, "headless" cannot be found in the log file, and neither can
> I find "UTF."
>
> WHAT COULD BE GOING WRONG HERE?
>
> --
> JHHL
I'm not a Windows person, but here's how I did it:
1. Do a normal installation of Tomcat with service.bat
service.bat install
2. Start up the Windows monitor service
tomcat7w.exe
3. Navigate to the Java tab
4. Select the Java Options: window
5. Add your additional requirements 1 per line:
-Djavax.servlet.request.encoding=UTF-8
-Dfile.encoding=UTF-8
-Djava.awt.headless=true
6. Start Tomcat
7. Observe logs in %CATALINA_BASE%\logs
tomcat7-stderr.2016-09-01.log
INFO: Command line argument: -Djavax.servlet.request.encoding=UTF-8
INFO: Command line argument: -Dfile.encoding=UTF-8
INFO: Command line argument: -Djava.awt.headless=true
Now you could probably add these with tomcat7 //US//Tomcat7 with the
suitable ++JvmOptions arguments, but it looks like it replaces the
original ++JvmOptions. That means you'd have to duplicate the original
options (see service.bat) as well as add the above three options.
tomcat7w.exe seems easier, but if you're doing unattended installations
modifying service.bat (or creating your own tomcat7.exe command line)
might be easier.
See the following:
https://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html
as a reference.
. . . just my two cents
/mde/
Re: AT WITS END regarding JVM arguments
Posted by Jim Johnson <ja...@gmail.com>.
Hi James,
On Thu, Sep 1, 2016 at 2:36 PM, James H. H. Lampert <
jamesl@touchtonecorp.com> wrote:
> Ladies and Gentlemen:
>
> One of our Tomcat servers (refreshed from apache-tomcat-7.0.67-windows-x86.zip)
> is running AS A SERVICE on a Windows box.
>
> And we need to set JVM Options of
> -Djavax.servlet.request.encoding=UTF-8
> -Dfile.encoding=UTF-8
> -Djava.awt.headless=true
>
> Unlike IBM Midrange boxes, on which I can, with a simple OS command, list
> all the JVMs currently running on the system, and look up the arguments,
> environment variables, system properties, &c, I can't find any way to
> verify the JVM arguments (this box has only a JRE, not a JDK), other than
> what gets sent to the log file. I even tried installing a trial of
> JProfiler, but if checking arguments is in there, it's well-hidden!
>
> I just tried adding a "setenv.bat" to the "bin" directory, containing
>
> SET CATALINA_OPTS=-Djava.awt.headless=true -Djavax.servlet.request.encoding=UTF-8
>> -Dfile.encoding=UTF-8
>>
>
> and after stopping and starting the service, even after rebooting the
> Windows box, "headless" cannot be found in the log file, and neither can I
> find "UTF."
>
> WHAT COULD BE GOING WRONG HERE?
>
> --
> JHHL
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
I don't run Tomcat on Windows so there might be a typo in this line here
but in your setenv.bat have you tried something like:
SET JAVA_OPTS="%JAVA_OPTS% -Djava.awt.headless=true
-Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8"
instead of using CATALINA_OPTS? We use JAVA_OPTS in our setenv.sh file for
Linux, perhaps it will work for Windows as well ...
- Jim
RE: AT WITS END regarding JVM arguments
Posted by Jeffrey Janner <Je...@PolyDyne.com>.
Sorry for reviving an old thread, but this one caught my eye and I just had to make some, admittedly off-topic, comments per the concept of assumptions that pervaded a number of the posts here.
1) Having worked with all manner of IBM systems, as well as some environments you guys probably never heard of, why anyone would assume that the way you do it in an IBM environment is the way you would do it anywhere else is beyond me. Heck, it often doesn't work the same way going from one IBM environment to another. (obligatory IBM dig here)
2) Trying to implement something in the Windows environment, I would assume that someone would go ahead and use the fine Windows installer that someone has been kind enough to create and maintain over the years -- instead of installing from the zip file. But then again, people on this list keep proving me wrong on this point.
3) Assuming something works on Windows, or any Microsoft implementation, the same way it works in other environments is also beyond me (obligatory Microsoft dig here)
4) Someone beginning to work in a new environment would read all available documentation on said environment as well as the related documentation of the application they wish to use that specifically targets that environment. But that takes time, and with the sorry state of documentation these days, or lack thereof, it doesn't really surprise me that someone wouldn't. Pretty soon, we will be at the other end of the spectrum from the old IBM 360/370 days, where documentation was not only voluminous, but also incomprehensible. That end of the spectrum ends with "completely non-existent, good luck reading the source code".
It's been one of those weeks, and I had to get that off my chest. I've been in this industry since 1982, and the only thing that's really changed is the names. That and we can really mess things up much faster now.
Jeff
> -----Original Message-----
> From: James H. H. Lampert [mailto:jamesl@touchtonecorp.com]
> Sent: Thursday, September 08, 2016 3:49 PM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: AT WITS END regarding JVM arguments
>
> On 9/8/16, 12:23 PM, Christopher Schultz wrote:
>
> > Would you care to create an account on the Tomcat Wiki[1] and post
> > your CL program? It may help someone else running in similar
> > environments. In fact, if you want to write-up a whole page about
> > "Running Tomcat on IBM Midrange", you could include that as well as
> > any other nuggets you've collected throughout the years.
>
> Hmm. Looks like there are scant resources there for Tomcat on Midrange.
> (I bookmarked a page at mysamplecode.com that was very helpful with my
> first few installations.)
>
> I now have a Tomcat Wiki account, but it appears I need to request
> posting privileges (apparently via this very list?) in order to receive
> them.
>
> I'm enrolled as "JamesLampert"; I'll see what I can put together offline
> until I'm informed that I have posting privileges on the Wiki.
>
> --
> JHHL
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
James,
On 9/8/16 4:48 PM, James H. H. Lampert wrote:
> On 9/8/16, 12:23 PM, Christopher Schultz wrote:
>
>> Would you care to create an account on the Tomcat Wiki[1] and
>> post your CL program? It may help someone else running in
>> similar environments. In fact, if you want to write-up a whole
>> page about "Running Tomcat on IBM Midrange", you could include
>> that as well as any other nuggets you've collected throughout the
>> years.
>
> Hmm. Looks like there are scant resources there for Tomcat on
> Midrange. (I bookmarked a page at mysamplecode.com that was very
> helpful with my first few installations.)
>
> I now have a Tomcat Wiki account, but it appears I need to request
> posting privileges (apparently via this very list?) in order to
> receive them.
>
> I'm enrolled as "JamesLampert"; I'll see what I can put together
> offline until I'm informed that I have posting privileges on the
> Wiki.
Deputized. You should be able to edit pages and create new ones, now.
Have a look at this page, too:
https://wiki.apache.org/tomcat/FAQ/Other_Operating_Systems
(If you don't die of old age waiting for the page to load)
It's got virtually no information in there, but you could add some
good links if you've got 'em, plus a link to a page dedicated to the
IBM MidRange products.
I've also committed a change to the catalina.bat file and back-ported
it as far back as Tomcat 7. If there is significant interest in
back-porting it to Tomcat 6, it's easy enough to do. If someone asks,
I'll do it.
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJX7DK4AAoJEBzwKT+lPKRY0WcQAJmId0Lb5mJMd+gtlmEnm8ad
kvXoWqFZAHsOZisNMgMFg2clxK44NBEOalM6qsqGoQ0FoKrYGNEzrY/cjMLwbzDu
a18ASnu8b4JA1mRcHax0U2Ao3JxX5Ai8IWxfYnjMQhkeTMSGusG1U5y1jGjL36BQ
PiJyNu5gE40+H4+GhAYyt+evZoaAhZ0YRIXjjRGzJ1J3TCrEIx1AzWRsO0C4XizT
f7meakSMIQ7zq6PFC6Xn19xZ4VamQhQk1DHdAWUVEzGPXSxXa4RUY8mpfrHnGGG6
rqjrf9ye2zvj1T/8dA9Iqyv11ikFU143qzRaa32o9PZ0RCccqSM2EVXIkQ4VIbO3
M58BJLWyDIAXc/BusYGOqdqjC6oisQRzxS9KFBR7MJ+ZKKbKa0roIkmBxRcqN/PV
e6gh/EJzWviV7Cc0fek3YA/n0Tr+OO+z6t9XcQQToK6kL4ubXLLHHNpuHWaUOzpp
f3/MzdkCUHFBpm0Hr8afeaVfvg/pMqsCufawki7hYtl27FV/hX4GbSFqxpAnL4c1
52HQ690cq9RR1hkB8vYBi8n9qZKHNF0Q5Cr6B+VPKI4tjTioZK3IEsQT/SyOTsPk
U1v9bzkHIdefV+NY50AfQkWBEjzHeGkbQOs52FhjNWB/PrbRjmmmF3xwwq7G5y+f
P+zLx4L2sFFSaisFcsB3
=BrhY
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
On 9/8/16, 12:23 PM, Christopher Schultz wrote:
> Would you care to create an account on the Tomcat Wiki[1] and post
> your CL program? It may help someone else running in similar
> environments. In fact, if you want to write-up a whole page about
> "Running Tomcat on IBM Midrange", you could include that as well as
> any other nuggets you've collected throughout the years.
Hmm. Looks like there are scant resources there for Tomcat on Midrange.
(I bookmarked a page at mysamplecode.com that was very helpful with my
first few installations.)
I now have a Tomcat Wiki account, but it appears I need to request
posting privileges (apparently via this very list?) in order to receive
them.
I'm enrolled as "JamesLampert"; I'll see what I can put together offline
until I'm informed that I have posting privileges on the Wiki.
--
JHHL
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
James,
On 9/8/16 12:47 PM, James H. H. Lampert wrote:
> On 9/8/16, 8:34 AM, Christopher Schultz wrote:
>
>> James, would you care to provide a (simple) patch? You'll get
>> your name in the changelog :)
>
> Ok. In the initial comments for catalina.bat:
>
>> . . . rem Do not set the variables in this script. Instead put
>> them into a script rem setenv.bat in CATALINA_BASE/bin to keep
>> your customizations separate. rem rem CATALINA_HOME May point
>> at your Catalina "build" directory. . . .
>
> becomes something like (and note the capitalization on the first
> line, to make the warning stand out):
>
> . . . rem Do not set the variables in this script. Instead put
> them into a script rem setenv.bat in CATALINA_BASE/bin to keep
> your customizations separate. rem rem WHEN RUNNING TOMCAT AS A
> WINDOWS SERVICE: rem Environment Variables for are NOT set in
> scripts, and any rem attempt to set them in a setenv.bat script
> will be IGNORED. rem Instead, they are set in the Registry, and
> are most conveniently rem maintained with the "tomcat7w.exe"
> maintenance utility. rem rem CATALINA_HOME May point at your
> Catalina "build" directory. . . .
>
Looks reasonable. I'll adjust it slightly and commit the change.
> And the corresponding addition should probably also be made to
> catalina.sh, since *nix, Mac, and IBM Midrange users (all of whom
> would be more familiar with catalina.sh) are probably the people
> most likely to be unfamiliar with how things work on Windows, and
> to get caught by this "gotcha."
Possibly.
> FWIW, on an IBM Midrange box, I've found that the easiest way to
> launch Tomcat is via a CL program (a sort of COMPILED script for
> the native command language), that can look through the JVMs
> available, and select the most appropriate one, and can also set
> the environment variables (and even do it dynamically, from
> command-line parameters).
Would you care to create an account on the Tomcat Wiki[1] and post
your CL program? It may help someone else running in similar
environments. In fact, if you want to write-up a whole page about
"Running Tomcat on IBM Midrange", you could include that as well as
any other nuggets you've collected throughout the years.
Thanks,
- -chris
[1] http://wiki.apache.org/tomcat/ (click on "Login" at the top to
create an account -- super-intuitive, right?)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJX0bqcAAoJEBzwKT+lPKRYVloP/2aGQQIgp02r78cKGp0jUiqt
7EdHtAHnwKn7HeFKMs5kNVAHlZU+tdbzMMEdpx/dTB+J5o7/lL8VteQc6sQBZ3ZH
QV9FjJC7KkEzhlA+KgeoJRtmUyo5/RCs6m9C/dZGHx4SGED4BY9SPC06BYpLL3G7
LuZNntOkbDTjL1EXR9um5xnkz++vd8Ka0hTpqQWoR8Mx23jHqlwAzLLVArNrBtuA
YD3ujhndEhZS4a4I0wx+VxMIq8DyKb1fm0z21HSLLaHYlODMjlH9MOFANvHXAhrj
y+ri2TWVzoMip93sZCfj7q7ZpC5I0ntdid1sYtAsm6E22u4k9FO3PoIs1j/0bnEM
pA6mmekqBBRL9vgMK733ZoRBuwAMq3jHg+A4mEH1cJZGzjkFcr64eVhqDH40yLpF
f+8fJSFKqpL5XpbbN/eyPWyuRKDpD2izPyzDEFrMvSODR+UEuwZ7rPiROtOSFoa8
ZnbDGD642lmShxDBM1XuM67Ol+WB5HAHbRAZ6WDrmH98Fp5HbpIwzbsvETdQ2nwu
zz8ajRYaeO1xcDRDNmhunvB6m3oK8xB9GX1LGmZ767qWlE9N8NK14Hb8XvhU663j
na2XeX2+vWPGzI8nb9po5AOEEfsQ0hvQlrTFek4qDuOJHR5W+gleUuF113ZxzYr9
VpfDn1ed7T4VyGpNUQeN
=Osba
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
On 9/8/16, 8:34 AM, Christopher Schultz wrote:
> James, would you care to provide a (simple) patch? You'll get your
> name in the changelog :)
Ok. In the initial comments for catalina.bat:
> . . .
> rem Do not set the variables in this script. Instead put them into a script
> rem setenv.bat in CATALINA_BASE/bin to keep your customizations separate.
> rem
> rem CATALINA_HOME May point at your Catalina "build" directory.
> . . .
becomes something like (and note the capitalization on the first line,
to make the warning stand out):
. . .
rem Do not set the variables in this script. Instead put them into a
script
rem setenv.bat in CATALINA_BASE/bin to keep your customizations separate.
rem
rem WHEN RUNNING TOMCAT AS A WINDOWS SERVICE:
rem Environment Variables for are NOT set in scripts, and any
rem attempt to set them in a setenv.bat script will be IGNORED.
rem Instead, they are set in the Registry, and are most conveniently
rem maintained with the "tomcat7w.exe" maintenance utility.
rem
rem CATALINA_HOME May point at your Catalina "build" directory.
. . .
And the corresponding addition should probably also be made to
catalina.sh, since *nix, Mac, and IBM Midrange users (all of whom would
be more familiar with catalina.sh) are probably the people most likely
to be unfamiliar with how things work on Windows, and to get caught by
this "gotcha."
FWIW, on an IBM Midrange box, I've found that the easiest way to launch
Tomcat is via a CL program (a sort of COMPILED script for the native
command language), that can look through the JVMs available, and select
the most appropriate one, and can also set the environment variables
(and even do it dynamically, from command-line parameters).
I welcome any rephrasing on my addition to the comment block.
--
James H. H. Lampert
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Steve,
On 9/6/16 8:56 PM, Mekkelsen Madden, Steve wrote:
> -----Original Message----- From: James H. H. Lampert
> [mailto:jamesl@touchtonecorp.com] Sent: Tuesday, September 06, 2016
> 6:59 PM To: Tomcat Users List <us...@tomcat.apache.org> Subject:
> Re: AT WITS END regarding JVM arguments
>
> On 9/6/16, 8:05 AM, Christopher Schultz wrote:
>
>> It's worth noting that, when creating the service from the
>> command-line, the service.bat script will use the current
>> environment to configure the service. That means that
>> CATALINA_HOME and CATALINA_BASE are all used to configure the
>> service.
>>
>> Unfortunately, CATALINA_OPTS is not used. I'll have a look to see
>> how tough it would be to add CATALINA_OPTS-handling to
>> service.bat... it seems like it would be nice to do that, and
>> fairly easy.
>
> I wouldn't sweat that part. I still think that the best way to deal
> with the situation is to put a prominent warning in the preamble
> comments of the relevant configuration files, explaining that the
> configuration files are ignored when Tomcat is run as a Windows
> Service, including links to relevant online documentation for the
> configuration utility.
>
> I would say that it's valid to assume that somebody *installing*
> Tomcat on a Windows box, to be run as a service, might reasonably
> be expected to know about how it works, and how to configure it,
> whereas somebody like me, accustomed to other platforms, and who
> has never had a reason to study the Windows service part of the
> Tomcat docs, would have no reason to know about it.
>
> -- JHHL
>
> I do not agree with that statement. It is rarely if ever, safe to
> assume anything. For years, that IS what I've done to create the
> Windows Service. Why else would you have a service.bat file if it
> didn't create the service for you?? In prior releases (8.0.* and
> older), I have never had a problem with using this to create the
> Windows Tomcat Service. JVM Arguments get added, memory settings,
> arguments etc. Never a problem.
>
> If it is not working in 8.5 series, I'd say that's a regression
> issue to be fixed. Adding a preamble doesn't mean someone won't
> continue to create services this way. If the service.bat won't do
> it correctly there are two choices - fix it so it does create the
> service properly or remove it from the build and make people use
> the one that does do it correctly. An ounce of prevention saves a
> lot of headaches down the road for everyone. Let's go to the root
> of the issue, not apply a band aid to it.
There's no regression. James was just saying that it took him a long
time to figure out why hos changes weren't working. Documentation
tweaking is worthwhile.
James, would you care to provide a (simple) patch? You'll get your
name in the changelog :)
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJX0YT/AAoJEBzwKT+lPKRYbn4QAKDHnxYq25cupT1/+Pvr9GbB
btsbA+nXNx45PSjAdNLOBjIQ0TYyFe4sdlnSZiPeSoHPxD88W1pXEyNurdydC+/8
Fw/i/LCT/th56TffDqRdlxgQwvx3Hs7WgowSggqJWqrSr0MgNxeAH8HChh/s8c5C
Ig8dH7fhqd2cVboVmlFGz+2XBOq0lt4Vajlxh1Sc2dV0TJHIbEEO9tiClxNV1o3V
6A7ZnKNfBBDM5XE7ePjYBlCaDiif/+jdsFx2JNFTENSGQrOTRptLlXXSfQc1bidU
iBt0hQpMNughuKm3BZCpcbq+TkFriy+4ZxExGsosjK+sKzsyUIVG4L7fZnW0NJWX
1iD5KriZ48qx7HUkDYN1TxBT4vu4xRcHsX16ZR4vNBlGFXiel2wnZeC5Yvj/Gcli
Tbds6CpgklxhfP6JtVXeuSlmfK7kQmEVlprTLfP2MyeDGbFkNM+AT7egsX07rsGa
U06w7EZ89k5HoX9wMvrS5FpwhDiwvDR9yFrrpBE3ZdsBfFN6YLxCidmeQ79Ek6PQ
cbhAQxvCKTGZo4qRUzacdgV6w/hUilQ+Urv9X6Fn4OZs5Kr1A6fbofHjY8FJlN6i
Va5Kt09/QAB3tFqcc0lZsXni4utKNxR74syRxsj3zmckh4SZdXh4RKxxNpJbHZzU
eeI1OVuauGJRO4vR+ruE
=H1Cy
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: AT WITS END regarding JVM arguments
Posted by "Mekkelsen Madden, Steve" <St...@pega.com>.
-----Original Message-----
From: James H. H. Lampert [mailto:jamesl@touchtonecorp.com]
Sent: Tuesday, September 06, 2016 6:59 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: AT WITS END regarding JVM arguments
On 9/6/16, 8:05 AM, Christopher Schultz wrote:
> It's worth noting that, when creating the service from the
> command-line, the service.bat script will use the current environment
> to configure the service. That means that CATALINA_HOME and
> CATALINA_BASE are all used to configure the service.
>
> Unfortunately, CATALINA_OPTS is not used. I'll have a look to see how
> tough it would be to add CATALINA_OPTS-handling to service.bat... it
> seems like it would be nice to do that, and fairly easy.
I wouldn't sweat that part. I still think that the best way to deal with the situation is to put a prominent warning in the preamble comments of the relevant configuration files, explaining that the configuration files are ignored when Tomcat is run as a Windows Service, including links to relevant online documentation for the configuration utility.
I would say that it's valid to assume that somebody *installing* Tomcat on a Windows box, to be run as a service, might reasonably be expected to know about how it works, and how to configure it, whereas somebody like me, accustomed to other platforms, and who has never had a reason to study the Windows service part of the Tomcat docs, would have no reason to know about it.
--
JHHL
I do not agree with that statement. It is rarely if ever, safe to assume anything. For years, that IS what I've done to create the Windows Service. Why else would you have a service.bat file if it didn't create the service for you?? In prior releases (8.0.* and older), I have never had a problem with using this to create the Windows Tomcat Service. JVM Arguments get added, memory settings, arguments etc. Never a problem.
If it is not working in 8.5 series, I'd say that's a regression issue to be fixed. Adding a preamble doesn't mean someone won't continue to create services this way. If the service.bat won't do it correctly there are two choices - fix it so it does create the service properly or remove it from the build and make people use the one that does do it correctly. An ounce of prevention saves a lot of headaches down the road for everyone. Let's go to the root of the issue, not apply a band aid to it.
Steve
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
On 9/6/16, 8:05 AM, Christopher Schultz wrote:
> It's worth noting that, when creating the service from the
> command-line, the service.bat script will use the current environment
> to configure the service. That means that CATALINA_HOME and
> CATALINA_BASE are all used to configure the service.
>
> Unfortunately, CATALINA_OPTS is not used. I'll have a look to see how
> tough it would be to add CATALINA_OPTS-handling to service.bat... it
> seems like it would be nice to do that, and fairly easy.
I wouldn't sweat that part. I still think that the best way to deal with
the situation is to put a prominent warning in the preamble comments of
the relevant configuration files, explaining that the configuration
files are ignored when Tomcat is run as a Windows Service, including
links to relevant online documentation for the configuration utility.
I would say that it's valid to assume that somebody *installing* Tomcat
on a Windows box, to be run as a service, might reasonably be expected
to know about how it works, and how to configure it, whereas somebody
like me, accustomed to other platforms, and who has never had a reason
to study the Windows service part of the Tomcat docs, would have no
reason to know about it.
--
JHHL
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
James,
On 9/1/16 7:16 PM, James H. H. Lampert wrote:
>>> Seems to me that a paraphrase of the third paragraph quoted
>>> above ought to be added -- PROMINENTLY -- to the comment lines
>>> at the top of catalina.bat and catalina.sh, to keep midrange
>>> jocks like me from driving ourselves nuts trying to manipulate
>>> services the wrong way.
>
> On 9/1/16, 3:52 PM, Andr� Warnier (tomcat) wrote:
>> Maybe reading this would have helped :
>> http://wiki.apache.org/tomcat/FAQ/Windows#Q11
>>
>> (I wrote that, at a time just after when I was just as puzzled as
>> you are about these curious Windows thingies..)
>
> Thanks.
>
> It definitely helps explain what these things are, but I think the
> prominent notice I suggested for the preambles of the catalina.bat
> and catalina.sh procedure files would be better at alerting those
> who aren't WinDoze service jocks that for a WinDoze service
> installation, a setenv.bat or a setenv.sh (or any modification of
> existing *.bat or *.sh) would be a monumental waste of time and a
> source of potentially lethal (or at least insanity-inducing) levels
> of frustration.
It's worth noting that, when creating the service from the
command-line, the service.bat script will use the current environment
to configure the service. That means that CATALINA_HOME and
CATALINA_BASE are all used to configure the service.
Unfortunately, CATALINA_OPTS is not used. I'll have a look to see how
tough it would be to add CATALINA_OPTS-handling to service.bat... it
seems like it would be nice to do that, and fairly easy.
Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJXzttBAAoJEBzwKT+lPKRYUUwP/A8UwIItMyAtK3tDo8bs2zZ2
SP9+ajCcVGayC6k5xNJCR8Gi6PiOHozWb5t30odwzBvARVd3YUyKIEzVYGjn9UFA
u8rXoEBRnma+Itp71V+Cd7oAqKPaYuXMMuCwypRSzIshC/V6IWsNhwiiD6zIG8Ou
UpaYflQGW/NleDnR1vdch5Joq7+yg+HdtTDykS2MyXqTpnRFbVqnfVzUMGguOzIg
Ru/wgru63edxOau+BM5nQBB6Y60z4XcK4O9PgKAVzFBIYAVOfURoi+qzLEf6n0+K
jiOmVqunRoBhBn+HNOKovGSQerNMp7o0tXiufZhGZRAHeDQc0FwUAtX5AB69+kxJ
+HyKPQEYAL4vdnhSxHz5QdZyQrG71B4rSHbpUvWBc5tcXxvDKDg4C1ylaU/pRd2T
5G5YPtFdiqQY/bpVVaMLuu1jOkx8kFvDMBfgBJKv22ZHYQkoX7oM2e8GagA+PpOm
ZsENmAe5jl6xKOxjwxSGE2TPnFDJwpkDyzCMLnIxdFLsv3/3HvaawXe0jfh6iwcc
Hlmy9i4o8ISQ/fwhKuED18Eo4lU8eex7GHNRw9CaaD1Drz5L5HfdGAefbcLDlRfX
sK3VcehnzNCHSzzkw2Kf6tn1EZocFLlen2ERTRQLipdl3Y2ClM/84p0sYuxeXx1r
DM+qhD3sE6ga4Iyo76RW
=Hq5r
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
>> Seems to me that a paraphrase of the third paragraph quoted above
>> ought to be added -- PROMINENTLY -- to the comment lines at the top
>> of catalina.bat and catalina.sh, to keep midrange jocks like me
>> from driving ourselves nuts trying to manipulate services the
>> wrong way.
On 9/1/16, 3:52 PM, Andr Warnier (tomcat) wrote:
> Maybe reading this would have helped :
> http://wiki.apache.org/tomcat/FAQ/Windows#Q11
>
> (I wrote that, at a time just after when I was just as puzzled as you
> are about these curious Windows thingies..)
Thanks.
It definitely helps explain what these things are, but I think the
prominent notice I suggested for the preambles of the catalina.bat and
catalina.sh procedure files would be better at alerting those who aren't
WinDoze service jocks that for a WinDoze service installation, a
setenv.bat or a setenv.sh (or any modification of existing *.bat or
*.sh) would be a monumental waste of time and a source of potentially
lethal (or at least insanity-inducing) levels of frustration.
--
JHHL
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 01.09.2016 22:30, James H. H. Lampert wrote:
> On 9/1/16, 12:14 PM, Olaf Kock wrote:
>> if I'm remembering correctly, parameters for services are stored
>> somewhere in the registry. Instead of poking there, you should use the
>> tomcatw.exe executable which parameterizes the service.
>>
>> I hope that memory serves me right - it's been a long time since I last
>> touched windows. Last time I saw it, it spawned a dialog with proper
>> input fields for anything you might want to configure.
>>
>> setenv.bat would be used if you start through startup.bat or
>> catalina.bat - but is not touched by a service, as a service doesn't use
>> the batch files at all.
>
> Thanks. Your memory serves both of us quite well.
>
> Seems to me that a paraphrase of the third paragraph quoted above ought to be added --
> PROMINENTLY -- to the comment lines at the top of catalina.bat and catalina.sh, to keep
> midrange jocks like me from driving ourselves nuts trying to manipulate services the wrong
> way.
>
Maybe reading this would have helped :
http://wiki.apache.org/tomcat/FAQ/Windows#Q11
(I wrote that, at a time just after when I was just as puzzled as you are about these
curious Windows thingies..)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
On 9/1/16, 12:14 PM, Olaf Kock wrote:
> if I'm remembering correctly, parameters for services are stored
> somewhere in the registry. Instead of poking there, you should use the
> tomcatw.exe executable which parameterizes the service.
>
> I hope that memory serves me right - it's been a long time since I last
> touched windows. Last time I saw it, it spawned a dialog with proper
> input fields for anything you might want to configure.
>
> setenv.bat would be used if you start through startup.bat or
> catalina.bat - but is not touched by a service, as a service doesn't use
> the batch files at all.
Thanks. Your memory serves both of us quite well.
Seems to me that a paraphrase of the third paragraph quoted above ought
to be added -- PROMINENTLY -- to the comment lines at the top of
catalina.bat and catalina.sh, to keep midrange jocks like me from
driving ourselves nuts trying to manipulate services the wrong way.
--
JHHL
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AT WITS END regarding JVM arguments
Posted by Olaf Kock <to...@olafkock.de>.
Am 01.09.2016 um 20:36 schrieb James H. H. Lampert:
> ...
> I just tried adding a "setenv.bat" to the "bin" directory, containing
>
>> SET CATALINA_OPTS=-Djava.awt.headless=true
>> -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8
>
> and after stopping and starting the service, even after rebooting the
> Windows box, "headless" cannot be found in the log file, and neither
> can I find "UTF."
Hi James,
if I'm remembering correctly, parameters for services are stored
somewhere in the registry. Instead of poking there, you should use the
tomcatw.exe executable which parameterizes the service.
I hope that memory serves me right - it's been a long time since I last
touched windows. Last time I saw it, it spawned a dialog with proper
input fields for anything you might want to configure.
setenv.bat would be used if you start through startup.bat or
catalina.bat - but is not touched by a service, as a service doesn't use
the batch files at all.
Best,
Olaf
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org