RE: Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74

2023-05-11 Thread kmhuntly
Not sure if anyone cares or not but this is how I handle...

Unpack Tomcat to /opt/Apache/tomcat/apache-tomcat-
Create a link for the instance: /opt/Apache/tomcat/current ->
/opt/Apache/tomcat/apache-tomcat-

This effectively does the same thing as described below except instead of
copying binary content you just need to copy over the relevant configuration
from the old to the new. Works for my purposes anyway.

-Original Message-
From: Andr? van der Lugt  
Sent: Thursday, May 11, 2023 2:49 PM
To: Tomcat Users List 
Subject: RE: Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74

Hi Meltron,

> -Original Message-
> From: Meltron Kendrick 
> Sent: 11 May, 2023 19:09
> To: users@tomcat.apache.org
> Subject: Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74
> 
> I have NOT been able to locate clear HOW TO steps for this.
> 
> I am currently focused on MINOR upgrades.
> 
> I will commence a different thread when I raise the question for MAJOR 
> upgrades --- say from 9.x to 10.x  -- or 9.x to 11.x
> 
> IF someone can point me to a great resource...
> That would be tremendously helpful and truly appreciated.

Apache Tomcat home > Documentation has a Migration Guide
(https://tomcat.apache.org/migration.html), see subsection "For upgrading
between 9.0.x versions, ..."

Generally speaking, if you prepare your deployment according to RUNNING.txt
(see Tomcat distribution) sub-section "Advanced Configuration - Multiple
Tomcat Instances", the patch update can be fairly painless - all it takes is
replacing CATALINA_HOME/bin and CATALINA_HOME/lib with the contents of the
Tomcat update. And consulting the migration guide for potential breaking
changes. Works for me!

Good luck,
Andre


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



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



RE: Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74

2023-05-11 Thread Andr? van der Lugt
Hi Meltron,

> -Original Message-
> From: Meltron Kendrick 
> Sent: 11 May, 2023 19:09
> To: users@tomcat.apache.org
> Subject: Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74
> 
> I have NOT been able to locate clear HOW TO steps for this.
> 
> I am currently focused on MINOR upgrades.
> 
> I will commence a different thread when I raise the question for MAJOR
> upgrades --- say from 9.x to 10.x  -- or 9.x to 11.x
> 
> IF someone can point me to a great resource...
> That would be tremendously helpful and truly appreciated.

Apache Tomcat home > Documentation has a Migration Guide 
(https://tomcat.apache.org/migration.html), see subsection "For upgrading 
between 9.0.x versions, ..."

Generally speaking, if you prepare your deployment according to RUNNING.txt 
(see Tomcat distribution) sub-section "Advanced Configuration - Multiple Tomcat 
Instances", the patch update can be fairly painless - all it takes is replacing 
CATALINA_HOME/bin and CATALINA_HOME/lib with the contents of the Tomcat update. 
And consulting the migration guide for potential breaking changes. Works for me!

Good luck,
Andre


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



RE: Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74

2023-05-11 Thread jonmcalexander
How are you configured? Is your CATALINA_HOME and CATALINA_BASE Identical, or 
do you have the binaries separated from the configuration (Different 
CATALINA_BASE directory)?

Thanks,

Dream * Excel * Explore * Inspire
Jon McAlexander
Senior Infrastructure Engineer
Asst. Vice President
He/His

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexan...@wellsfargo.com
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.

> -Original Message-
> From: Meltron Kendrick 
> Sent: Thursday, May 11, 2023 12:09 PM
> To: users@tomcat.apache.org
> Subject: Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74
> 
> I have NOT been able to locate clear HOW TO steps for this.
> 
> I am currently focused on MINOR upgrades.
> 
> I will commence a different thread when I raise the question for MAJOR
> upgrades --- say from 9.x to 10.x  -- or 9.x to 11.x
> 
> IF someone can point me to a great resource...
> That would be tremendously helpful and truly appreciated.
> 
> --- Meltron
> --
> ==
> Blessed Regards,
> 
> Meltron Kendrick
> Sr. Systems Engineer
> Linux * Windows * Cloud Computing * Security
> 
> LinkedIn:
> https://urldefense.com/v3/__http://www.linkedin.com/in/meltronkendrick
> __;!!F9svGWnIaVPGSwU!r0uxyULun0y9k3b9Q63cnHz94phOAv0bIK0U-
> WE54Llt5pLwOBfbkqXYSpxjrVMBAlehdpcNGql2wbGTnTLs5u2Ln-Ysz7gTeA$
> 
> Mobile: (512) 233-9176
> Email: meltronkendr...@gmail.com

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



Best Practice to Upgrade Apache Tomcat from 9.0.56 to 9.0.74

2023-05-11 Thread Meltron Kendrick
I have NOT been able to locate clear HOW TO steps for this.

I am currently focused on MINOR upgrades.

I will commence a different thread when I raise the question for MAJOR
upgrades --- say from 9.x to 10.x  -- or 9.x to 11.x

IF someone can point me to a great resource...
That would be tremendously helpful and truly appreciated.

--- Meltron
-- 
==
Blessed Regards,

Meltron Kendrick
Sr. Systems Engineer
Linux * Windows * Cloud Computing * Security

LinkedIn: http://www.linkedin.com/in/meltronkendrick

Mobile: (512) 233-9176
Email: meltronkendr...@gmail.com


AW: Java Agent and Tomcat shutdown

2023-05-11 Thread Thomas Hoffmann (Speed4Trade GmbH)
Hello Peter,

> -Ursprüngliche Nachricht-
> Von: l...@kreuser.name 
> Gesendet: Donnerstag, 11. Mai 2023 16:16
> An: Tomcat Users List 
> Betreff: Re: Java Agent and Tomcat shutdown
> 
> Hi Thomas
> 
> > Am 11.05.2023 um 16:05 schrieb Thomas Hoffmann (Speed4Trade GmbH)
> :
> >
> > Hello,
> >
> > we are using a java agent to start a listening process (JMX proxy).
> >
> > The systemd file for tomcat looks like (snippet):
> > JAVA_OPTS=... -javaagent:/opt/runtime/jmxagent/jmxagent.jar
> > -Dorg.goktay.rmiregistry.port=15000 -Dorg.goktay.rmiserver.port=15001
> 
> 
> I do think that setting JAVA_OPTS is triggering this behavior: EVERY java
> process contains this rmi server with this conflicting port.
> 
> The way to go is using CATALINA_OPTS. The options go only into the start-
> process...
 
You are completely right. Everything makes sense now 
Thanks for the quick help!
Much appreciated!

> HTH
> 
> Peter
> 
> > ExecStart=/opt/apache-tomcat/bin/catalina.sh run
> > ExecStop=/opt/apache-tomcat/bin/catalina.sh stop 60
> >
> > When starting the service, everything works fine and the java agent is
> accessible via the opened port 15000.
> >
> > However, when stopping tomcat, it seems that a java process is started and
> tries to open the same port again:
> > 2670]: Exception in thread "main" 
> > java.lang.reflect.InvocationTargetException
> >at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> >at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethod
> AccessorImpl.java:77)
> >at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Delegatin
> gMethodAccessorImpl.java:43)
> >at java.base/java.lang.reflect.Method.invoke(Method.java:568)
> >at
> java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(In
> strumentationImpl.java:493)
> >at
> > java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPre
> > main(InstrumentationImpl.java:503)
> > Caused by: java.rmi.server.ExportException: Port already in use: 15000;
> nested exception is:
> >java.net.BindException: Address already in use
> >at
> java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:346)
> >at
> java.rmi/sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:2
> 43)
> >at
> java.rmi/sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:415
> )
> >at java.rmi/sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
> >at
> java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:2
> 35)
> >at 
> > java.rmi/sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:223)
> >at 
> > java.rmi/sun.rmi.registry.RegistryImpl.(RegistryImpl.java:208)
> >at
> java.rmi/java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:20
> 3)
> >at org.goktay.jmx.JMXAgent.premain(JMXAgent.java:33)
> >... 6 more
> > Caused by: java.net.BindException: Address already in use
> >at java.base/sun.nio.ch.Net.bind0(Native Method)
> >at java.base/sun.nio.ch.Net.bind(Net.java:555)
> >at java.base/sun.nio.ch.Net.bind(Net.java:544)
> >at java.base/sun.nio.ch.NioSocketImpl.bind(NioSocketImpl.java:643)
> >at java.base/java.net.ServerSocket.bind(ServerSocket.java:388)
> >at java.base/java.net.ServerSocket.(ServerSocket.java:274)
> >at java.base/java.net.ServerSocket.(ServerSocket.java:167)
> >at
> java.rmi/sun.rmi.transport.tcp.TCPDirectSocketFactory.createServerSocket(TCP
> DirectSocketFactory.java:45)
> >at
> java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java
> :673)
> >at
> java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335)
> >... 14 more
> > *** java.lang.instrument ASSERTION FAILED ***: "result" with message
> > agent load/premain call failed at
> > src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
> >
> > The premain method is entered again and of course the port is already used.
> > Is there a way to stop tomcat without re-entering the java agent?
> > Using shutdown.sh shows the same problem.
> >
> > Thanks in advance!
> > Thomas
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java Agent and Tomcat shutdown

2023-05-11 Thread logo
Hi Thomas

> Am 11.05.2023 um 16:05 schrieb Thomas Hoffmann (Speed4Trade GmbH) 
> :
> 
> Hello,
> 
> we are using a java agent to start a listening process (JMX proxy).
> 
> The systemd file for tomcat looks like (snippet):
> JAVA_OPTS=... -javaagent:/opt/runtime/jmxagent/jmxagent.jar 
> -Dorg.goktay.rmiregistry.port=15000 -Dorg.goktay.rmiserver.port=15001


I do think that setting JAVA_OPTS is triggering this behavior: EVERY java 
process contains this rmi server with this conflicting port.

The way to go is using CATALINA_OPTS. The options go only into the 
start-process...

HTH 

Peter

> ExecStart=/opt/apache-tomcat/bin/catalina.sh run
> ExecStop=/opt/apache-tomcat/bin/catalina.sh stop 60
> 
> When starting the service, everything works fine and the java agent is 
> accessible via the opened port 15000.
> 
> However, when stopping tomcat, it seems that a java process is started and 
> tries to open the same port again:
> 2670]: Exception in thread "main" java.lang.reflect.InvocationTargetException
>at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>at 
> java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:493)
>at 
> java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
> Caused by: java.rmi.server.ExportException: Port already in use: 15000; 
> nested exception is:
>java.net.BindException: Address already in use
>at 
> java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:346)
>at 
> java.rmi/sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:243)
>at 
> java.rmi/sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:415)
>at java.rmi/sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
>at 
> java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:235)
>at java.rmi/sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:223)
>at java.rmi/sun.rmi.registry.RegistryImpl.(RegistryImpl.java:208)
>at 
> java.rmi/java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
>at org.goktay.jmx.JMXAgent.premain(JMXAgent.java:33)
>... 6 more
> Caused by: java.net.BindException: Address already in use
>at java.base/sun.nio.ch.Net.bind0(Native Method)
>at java.base/sun.nio.ch.Net.bind(Net.java:555)
>at java.base/sun.nio.ch.Net.bind(Net.java:544)
>at java.base/sun.nio.ch.NioSocketImpl.bind(NioSocketImpl.java:643)
>at java.base/java.net.ServerSocket.bind(ServerSocket.java:388)
>at java.base/java.net.ServerSocket.(ServerSocket.java:274)
>at java.base/java.net.ServerSocket.(ServerSocket.java:167)
>at 
> java.rmi/sun.rmi.transport.tcp.TCPDirectSocketFactory.createServerSocket(TCPDirectSocketFactory.java:45)
>at 
> java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:673)
>at 
> java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335)
>... 14 more
> *** java.lang.instrument ASSERTION FAILED ***: "result" with message agent 
> load/premain call failed at 
> src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
> 
> The premain method is entered again and of course the port is already used.
> Is there a way to stop tomcat without re-entering the java agent?
> Using shutdown.sh shows the same problem.
> 
> Thanks in advance!
> Thomas
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



Java Agent and Tomcat shutdown

2023-05-11 Thread Thomas Hoffmann (Speed4Trade GmbH)
Hello,

we are using a java agent to start a listening process (JMX proxy).

The systemd file for tomcat looks like (snippet):
  JAVA_OPTS=... -javaagent:/opt/runtime/jmxagent/jmxagent.jar 
-Dorg.goktay.rmiregistry.port=15000 -Dorg.goktay.rmiserver.port=15001
  ExecStart=/opt/apache-tomcat/bin/catalina.sh run
  ExecStop=/opt/apache-tomcat/bin/catalina.sh stop 60

When starting the service, everything works fine and the java agent is 
accessible via the opened port 15000.

However, when stopping tomcat, it seems that a java process is started and 
tries to open the same port again:
2670]: Exception in thread "main" java.lang.reflect.InvocationTargetException
 at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
 at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:568)
 at 
java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:493)
 at 
java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
 Caused by: java.rmi.server.ExportException: Port already in use: 15000; nested 
exception is:
 java.net.BindException: Address already in use
 at 
java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:346)
 at 
java.rmi/sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:243)
 at 
java.rmi/sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:415)
 at java.rmi/sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
 at 
java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:235)
 at java.rmi/sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:223)
 at java.rmi/sun.rmi.registry.RegistryImpl.(RegistryImpl.java:208)
 at 
java.rmi/java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
 at org.goktay.jmx.JMXAgent.premain(JMXAgent.java:33)
 ... 6 more
 Caused by: java.net.BindException: Address already in use
 at java.base/sun.nio.ch.Net.bind0(Native Method)
 at java.base/sun.nio.ch.Net.bind(Net.java:555)
 at java.base/sun.nio.ch.Net.bind(Net.java:544)
 at java.base/sun.nio.ch.NioSocketImpl.bind(NioSocketImpl.java:643)
 at java.base/java.net.ServerSocket.bind(ServerSocket.java:388)
 at java.base/java.net.ServerSocket.(ServerSocket.java:274)
 at java.base/java.net.ServerSocket.(ServerSocket.java:167)
 at 
java.rmi/sun.rmi.transport.tcp.TCPDirectSocketFactory.createServerSocket(TCPDirectSocketFactory.java:45)
 at 
java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:673)
 at 
java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335)
 ... 14 more
 *** java.lang.instrument ASSERTION FAILED ***: "result" with message agent 
load/premain call failed at 
src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422

The premain method is entered again and of course the port is already used.
Is there a way to stop tomcat without re-entering the java agent?
Using shutdown.sh shows the same problem.

Thanks in advance!
Thomas

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



Re: Setting service parameters not work in Tomcat 8.5.85+

2023-05-11 Thread Mark Thomas

On 10/05/2023 22:06, Gilles Maurice wrote:

Hello,

Our product currently uses Tomcat 8.5.83. We wanted to upgrade to Tomcat 
8.5.88 but our product fails to start up with this version.


 From my research I was able to determine the following facts:
- Upgrade to 8.5.84 works fine
- Upgrade to 8.5.85+ fails
- Our product uses "tomcat8.exe //US/vlm" to update the service 
parameters (vlm is the internal name of our product)
- with 8.5.85, calling the following command works fine: tomcat8.exe 
//US/vlm --Description myDescription
- setting java parameters don't work however, for example this command 
fails: tomcat8.exe //US/vlm --JvmMs 128
- when running the command above, tomcat8.exe does not display an error 
but the service is not updated
- the documentation at 
https://tomcat.apache.org/tomcat-8.5-doc/windows-service-howto.html 
indicates that the java update parameters are not set when in exe mode 
but ours is in jvm mode. For example, the following command will not set 
the JvmMs value: tomcat8.exe //US/vlm --Jvm auto --StartMode jvm 
--StopMode jvm --JvmMs 128


Does anyone have any info on how to get around this?


I am unable to recreate the problem described.

tomcat8.exe //US/Tomcat8 --JvmMs 128

works for me with a clean Tomcat installation.

How are you determining if the service is updated?

Otherwise, can someone direct me to the source code for tomcat8.exe so I 
can see if I can find the cause of this issue myself?


You want Commons Daemon. Tomcat 8.5.85 upgraded from 1.3.2 to 1.3.3.

https://github.com/apache/commons-daemon

Tomcat8.exe is a renamed prunsrv.exe

Tomcat8w.exe is a renamed prunmgr.exe


Mark

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