RE: Compatibility, 32 bit ..

2022-10-25 Thread Harri Pesonen
Java 9 dropped 32-bit so it only has 64-bit by default.
Maybe you have Java 8 instead of Java 9.
Check this:

https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04

Try using Tomcat 8.5 if you want to have 32-bit.

-Harri

-Original Message-
From: John Dale (DB2DOM)  
Sent: maanantai 24. lokakuuta 2022 22.03
To: Tomcat Users List 
Subject: Re: Compatibility, 32 bit ..

[Et saa yleensä sähköpostia jcdw...@gmail.com. Lisätietoja siitä, miksi tämä on 
tärkeää, on osoitteessa https://aka.ms/LearnAboutSenderIdentification ]

Thank you.

Would you agree with me that this should be an ubuntu bug report?  I installed 
using apt-get.

John


On 10/24/22, Mark Thomas  wrote:
> On 24/10/2022 19:38, John Dale (DB2DOM) wrote:
>> Would Tomcat 10 work with Java 8?
>
> No. Tomcat 10.1.x requires a minimum of Java 11.
>
> Details of Tomcat versions, minimum Java versions and other useful
> information:
>
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftomc
> at.apache.org%2Fwhichversion.htmldata=05%7C01%7Charri.pesonen%40s
> inch.com%7C14e753cc45db4bab086608dab5f28056%7C3b518aae89214a7b8497619d
> 756ce20e%7C0%7C0%7C638022350412584072%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7
> C%7Csdata=m6n2gaXUVUU39CvV0AtbByiUWfqDCK%2F7w7pLsEzcSr8%3Dre
> served=0
>
> Mark
>
>
>>
>> Thinking I might downgrade the JDK.
>>
>>
>> On 10/24/22, Mark Thomas  wrote:
>>>
>>>
>>> On 24/10/2022 17:00, John Dale (DB2DOM) wrote:
 Hi Mark;

 Thanks for taking a look.

 Below is more information.

 Sincerely,

 John Dale, MS MIS
 Spearfish, SD USA

 -

 Tomcat version: 10.0.27 (unzipped, chmod 770 on catalina.sh before
 cli: catalina.sh run)
 java version: openjdk version "9-internal"
 uname -m: i686
 Ubuntu 18.0.4

 First error in logs:
 24-Oct-2022 09:52:24.411 SEVERE [main] 
 org.apache.tomcat.util.compat.Jre9Compat. Failed to create 
 references to Java 9 classes and methods
   java.lang.ClassNotFoundException: java.lang.ModuleLayer
>>>
>>> You appear to have a broken JRE. That class should always be present 
>>> in Java 9 onwards.
>>>
>>> Mark
>>>
>>>
   at
 java.net.URLClassLoader.findClass(java.base@9-internal/URLClassLoader.java:384)
   at
 java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:486)
   at
 java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
   at
 java.lang.Class.forName0(java.base@9-internal/Native
 Method)
   at
 java.lang.Class.forName(java.base@9-internal/Class.java:294)
   at
 org.apache.tomcat.util.compat.Jre9Compat.(Jre9Compat.java:85)
   at
 org.apache.tomcat.util.compat.JreCompat.(JreCompat.java:72)
   at
 org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:282)
   at
 org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
   at
 org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
   at
 org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:135)
   at
 org.apache.catalina.startup.Catalina.load(Catalina.java:747)
   at
 org.apache.catalina.startup.Catalina.load(Catalina.java:769)
   at
 sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/N
 ative
 Method)
   at
 sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
   at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
   at
 java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
   at
 org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:305)
   at
 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)



 On 10/24/22, Mark Thomas  wrote:
> On 24/10/2022 02:01, John Dale (DB2DOM) wrote:
>> Hi Everyone;
>>
>> I've had a few requests to refurbish some old 32 bit dell towers.
>>
>> So, I'm throwing ubuntu on them and bringing up a
>> MySQL->DB2DOM->Tomcat
>> stack.
>>
>> Unfortunately, Tomcat doesn't want to start with openjdk 9 that 
>> is packaged with 32 bit ubuntu.
>
> Tomcat works happily with 32-bit and 64-bit Java.
>
>> Can someone give me a pointer to what works best?
> Perhaps if you told us what Tomcat version you were using and 
> showed us what the error message was we'd be able to 

RE: Reconfiguring Tomcat application without restart

2022-04-13 Thread Harri Pesonen
Hello, so we have application that should get a new configuration, CORS in this 
case, on the fly, without restarting the application, because it can have 
thousands of active connections.
Currently the configuration is stored in this application configuration file

$CATALINA_HOME/conf/Catalina/localhost/app.xml

and application gets it on startup and implements CORS restrictions. We have a 
need to change the configuration every now and then.
For example, I could possibly read the file once a minute, parse XML etc. and 
update settings, unless Tomcat is prohibiting the file access.
Application does not necessarily know the file path though, so it should be 
hard coded, which would be bad.
Tomcat has the code somewhere to do it, but it is likely an internal class.
We can workaround this by saving the configuration elsewhere, like in Windows 
registry, and read it from there once a minute.
Or we could save it to database.
But currently the configuration is in this deployment descriptor file, so I am 
asking if this has come up before.
Is there any other "standard" way of having mutable configuration for Tomcat 
application?

-Harri

-Original Message-
From: Christopher Schultz  
Sent: keskiviikko 13. huhtikuuta 2022 19.20
To: users@tomcat.apache.org
Subject: Re: Reconfiguring Tomcat application without restart

Harri,

On 4/13/22 07:32, Harri Pesonen wrote:
> Hello, is it possible to change the context file in
> 
> $CATALINA_HOME/conf/Catalina/localhost/app.xml
> 
> so that application would get the new configuration without restarting?

Without restarting... what exactly? And what would you want to change? 
Usually the things in that deployment descriptor are pretty fundamental to how 
the application starts-up, etc.

> I could not find such thing in servlet specification.

The servlet spec doesn't have anything like this in there, but Tomcat does. 
Sort of, depending upon exactly what you are trying to accomplish.

> Or would it be possible to manually read the file from the application, for 
> example once a minute?
> Now the application gets the configuration from init():
> 
> javax.servlet.GenericServlet.java
> 
>  /**
>   * Called by the servlet container to indicate to a servlet that the
>   * servlet is being placed into service.  See {@link Servlet#init}.
>   *
>   * This implementation stores the {@link ServletConfig}
>   * object it receives from the servlet container for later use.
>   * When overriding this form of the method, call
>   * super.init(config).
>   *
>   * @param config 
> the ServletConfig object
>   *   
>   that 
> contains configutation
>   *   
>   information 
> for this servlet
>   *
>   * @exception ServletExceptionif an exception occurs 
> that
>   *   
>   interrupts 
> the servlet's normal
>   *   
>   operation
>   *
>   * @see  
>   UnavailableException
>   */
>  public void init(ServletConfig config) throws ServletException {
>   this.config = config;
>   this.init();
>  }
> 
> I suppose that getServletConfig() returns the same cached data without 
> re-reading it from disk?
> 
>  /**
>   * Returns this servlet's {@link ServletConfig} object.
>   *
>   * @return ServletConfigthe ServletConfig object
>   *   
>  that initialized this servlet
>   */
>  public ServletConfig getServletConfig() {
>   return config;
>  }

Can you be more specific about what you want to achieve? I have some ideas, but 
before I send you down a potentially confusing path, it would be good to 
understand your goals.

-chris

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



Reconfiguring Tomcat application without restart

2022-04-13 Thread Harri Pesonen
Hello, is it possible to change the context file in

$CATALINA_HOME/conf/Catalina/localhost/app.xml

so that application would get the new configuration without restarting?
I could not find such thing in servlet specification.
Or would it be possible to manually read the file from the application, for 
example once a minute?
Now the application gets the configuration from init():

javax.servlet.GenericServlet.java

/**
 * Called by the servlet container to indicate to a servlet that the
 * servlet is being placed into service.  See {@link Servlet#init}.
 *
 * This implementation stores the {@link ServletConfig}
 * object it receives from the servlet container for later use.
 * When overriding this form of the method, call
 * super.init(config).
 *
 * @param config
 the ServletConfig object
 *  
   that contains 
configutation
 *  
   information for 
this servlet
 *
 * @exception ServletExceptionif an exception occurs 
that
 *  
   interrupts the 
servlet's normal
 *  
   operation
 *
 * @see 
   UnavailableException
 */
public void init(ServletConfig config) throws ServletException {
 this.config = config;
 this.init();
}

I suppose that getServletConfig() returns the same cached data without 
re-reading it from disk?

/**
 * Returns this servlet's {@link ServletConfig} object.
 *
 * @return ServletConfigthe ServletConfig object
 *  
  that initialized this servlet
 */
public ServletConfig getServletConfig() {
 return config;
}

-Harri



RE: Two context paths to same application

2022-04-05 Thread Harri Pesonen
Ok, it is a bit disappointing that Tomcat does not support this in standard 
webapps folder.
But I found an easy workaround: create Windows junction app#latest that points 
to app#1 folder (both in webapps).

-Harri

-Original Message-
From: Mark Thomas  
Sent: perjantai 1. huhtikuuta 2022 18.46
To: users@tomcat.apache.org
Subject: Re: Two context paths to same application

On 01/04/2022 15:59, Harri Pesonen wrote:
> Hello,
> 
> while reading the documentation in
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftomc
> at.apache.org%2Ftomcat-8.5-doc%2Fconfig%2Fcontext.html%23Namingda
> ta=04%7C01%7Charri.pesonen%40sinch.com%7Cdac1869da5b046b4f23e08da13f6c
> c02%7C3b518aae89214a7b8497619d756ce20e%7C0%7C0%7C637844248015649619%7C
> Unknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h
> aWwiLCJXVCI6Mn0%3D%7C3000sdata=vHZmEqMaCuKbja9GN1vHfCgD5pEKVLzYsb
> L21ZaJtvg%3Dreserved=0 it is not clear to me how to achieve the 
> following:
> 
> Have one WAR file with corresponding directory, for example:
> 
> app#1.war => app#1 (directory) => /app/1 (context path)
> 
> But have another context path pointing to same application:
> 
> /app/latest (context path) => app#1 (directory)
> 
> I tried adding  to server.xml inside  like:
> 
> 
> 
> But Tomcat created another directory app#latest from this, and copied app#1 
> there.
> I would like to avoid having duplicate directories.
> 
> Doc says that:
> * To define multiple contexts that use a single WAR file or directory, use 
> one of the options described in the Naming section above for creating a 
> Context that has a path that is not related to the base file name.
> * If you want to deploy a WAR file or a directory using a context path that 
> is not related to the base file name then one of the following options must 
> be used to prevent double-deployment:
> ** Disable autoDeploy and deployOnStartup and define all Contexts in 
> server.xml
> ** Locate the WAR and/or directory outside of the Host's appBase and use a 
> context.xml file with a docBase attribute to define it.
> 
> Don't quite understand what to do.
> Do I need add  also to the existing application:
> 
> 
> 
> Or what does "define all Contexts in server.xml" mean?
> And what does the second option (Locate the WAR...) mean?

The key part is you need to locate the docBase (the web application WAR or 
directory) NOT under the appBase ($CATALINA_BASE/webapps). So something like 
this:

/opt/webapps/myapp-1

and then under $CATALINA_BASE/conf/Catlaina/localhost you'll need two context 
files:

myapp#1.xml


myapp#latest.xml


HTH,

MarK

-
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



Two context paths to same application

2022-04-01 Thread Harri Pesonen
Hello,

while reading the documentation in
https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming
it is not clear to me how to achieve the following:

Have one WAR file with corresponding directory, for example:

app#1.war => app#1 (directory) => /app/1 (context path)

But have another context path pointing to same application:

/app/latest (context path) => app#1 (directory)

I tried adding  to server.xml inside  like:



But Tomcat created another directory app#latest from this, and copied app#1 
there.
I would like to avoid having duplicate directories.

Doc says that:
* To define multiple contexts that use a single WAR file or directory, use one 
of the options described in the Naming section above for creating a Context 
that has a path that is not related to the base file name.
* If you want to deploy a WAR file or a directory using a context path that is 
not related to the base file name then one of the following options must be 
used to prevent double-deployment:
** Disable autoDeploy and deployOnStartup and define all Contexts in server.xml
** Locate the WAR and/or directory outside of the Host's appBase and use a 
context.xml file with a docBase attribute to define it.

Don't quite understand what to do.
Do I need add  also to the existing application:



Or what does "define all Contexts in server.xml" mean?
And what does the second option (Locate the WAR...) mean?

Thanks,

-Harri



RE: NullPointerException in Tomcat startup while parsing XML configuration file

2022-03-15 Thread Harri Pesonen
Hello, that xml file is embedded in catalina.jar, so obviously I have not 
modified it:

jar:file:/C:/Tomcat/tomcat_home/lib/catalina.jar!/org/apache/catalina/mbeans/mbeans-descriptors.xml

It does not prevent Tomcat startup.
It only prevents me from finding the NullPointerException in my application 
startup.
But because NullPointerException is always a bug, I was thinking that someone 
might be interested.
You already have the important stack trace lines in this message, and you can 
easily reproduce the problem by starting Tomcat in debugger and having 
breakpoint in NullPointerException.

-Harri

-Original Message-
From: Christopher Schultz  
Sent: maanantai 14. maaliskuuta 2022 16.36
To: users@tomcat.apache.org
Subject: Re: NullPointerException in Tomcat startup while parsing XML 
configuration file

Harri,

On 3/14/22 10:23, Harri Pesonen wrote:
> Hello, I don't know if this is interesting, but while I started Tomcat 
> in IDEA debugger, when I had breakpoint set to NullPointerException (so that 
> it breaks on all of them), then it break here:
> 
> org\apache\tomcat\tomcat-util\8.5.75\tomcat-util-8.5.75.jar!\org\apach
> e\tomcat\util\IntrospectionUtils.class
> 
> public static String replaceProperties(String value, Hashtable Object> staticProp, IntrospectionUtils.PropertySource[] dynamicProp, 
> ClassLoader classLoader) {
>  if (value.indexOf(36) < 0) {
> 
> "value" is null.
> 
> A bit more up in stack trace, it is here:
> 
> org\apache\tomcat\tomcat-util-scan\8.5.75\tomcat-util-scan-8.5.75.jar!
> \org\apache\tomcat\util\digester\Digester.class
> 
> public InputSource resolveEntity(String name, String publicId, String 
> baseURI, String systemId) throws SAXException, IOException {
>  name = this.replace(name);
> 
> "name" is null.
> 
> One more up:
> 
> java.xml\com\sun\org\apache\xerces\internal\util\EntityResolver2Wrappe
> r.java
> 
> String name = null;
> if (resourceIdentifier instanceof XMLDTDDescription) {
>  name = "[dtd]";
> }
> else if (resourceIdentifier instanceof XMLEntityDescription) {
>  name = ((XMLEntityDescription) 
> resourceIdentifier).getEntityName();
> }
> 
> // When both pubId and sysId are null, the user's entity resolver // 
> can do nothing about it. We'd better not bother calling it.
> // This happens when the resourceIdentifier is a GrammarDescription, 
> // which describes a schema grammar of some namespace, but without // 
> any schema location hint. -Sg if (pubId == null && sysId == null) {
>  return null;
> }
> 
> // Resolve using EntityResolver2
> try {
>  InputSource inputSource =
>  fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);
> 
> "name" is null.
> 
> It was parsing this:
> 
> jar:file:/C:/Tomcat/tomcat_home/lib/catalina.jar!/org/apache/catalina/
> mbeans/mbeans-descriptors.xml
> 
> So the problem seems to happen in org.apache.xerces XML parser, or in Tomcat.

Have you modified the stock mbeans-descriptors.xml file? Does this prevent 
startup in your environment? If so, please post the full stack trace. If this 
error is caught and ignored, than there is nothing to do.

-chris

-
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



NullPointerException in Tomcat startup while parsing XML configuration file

2022-03-14 Thread Harri Pesonen
Hello, I don't know if this is interesting, but while I started Tomcat in IDEA 
debugger, when I had breakpoint set to NullPointerException (so that it breaks 
on all of them),
then it break here:

org\apache\tomcat\tomcat-util\8.5.75\tomcat-util-8.5.75.jar!\org\apache\tomcat\util\IntrospectionUtils.class

public static String replaceProperties(String value, Hashtable 
staticProp, IntrospectionUtils.PropertySource[] dynamicProp, ClassLoader 
classLoader) {
if (value.indexOf(36) < 0) {

"value" is null.

A bit more up in stack trace, it is here:

org\apache\tomcat\tomcat-util-scan\8.5.75\tomcat-util-scan-8.5.75.jar!\org\apache\tomcat\util\digester\Digester.class

public InputSource resolveEntity(String name, String publicId, String baseURI, 
String systemId) throws SAXException, IOException {
name = this.replace(name);

"name" is null.

One more up:

java.xml\com\sun\org\apache\xerces\internal\util\EntityResolver2Wrapper.java

String name = null;
if (resourceIdentifier instanceof XMLDTDDescription) {
name = "[dtd]";
}
else if (resourceIdentifier instanceof XMLEntityDescription) {
name = ((XMLEntityDescription) resourceIdentifier).getEntityName();
}

// When both pubId and sysId are null, the user's entity resolver
// can do nothing about it. We'd better not bother calling it.
// This happens when the resourceIdentifier is a GrammarDescription,
// which describes a schema grammar of some namespace, but without
// any schema location hint. -Sg
if (pubId == null && sysId == null) {
return null;
}

// Resolve using EntityResolver2
try {
InputSource inputSource =
fEntityResolver.resolveEntity(name, pubId, baseURI, sysId);

"name" is null.

It was parsing this:

jar:file:/C:/Tomcat/tomcat_home/lib/catalina.jar!/org/apache/catalina/mbeans/mbeans-descriptors.xml

So the problem seems to happen in org.apache.xerces XML parser, or in Tomcat.

-Harri

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



RE: Tomcat 9 Encrpytion of JDBC

2022-01-20 Thread Harri Pesonen
Vault for Apache Tomcat:

https://github.com/web-servers/tomcat-vault

It hides the secrets in another encrypted file, and password for that file is 
then in another file...
So it just makes it more difficult to access the secrets, but at least they are 
not in plain text.

-Harri

-Original Message-
From: Orendt, John  
Sent: torstai 20. tammikuuta 2022 18.11
To: users@tomcat.apache.org
Subject: RE: Tomcat 9 Encrpytion of JDBC

[Et saa yleensä sähköpostia osoitteesta john.p.ore...@medtronic.com.invalid. 
Lue lisää siitä, miksi tämä on tärkeää, osoitteesta 
http://aka.ms/LearnAboutSenderIdentification.]

Hi

There are at least two types of mutual authentication.

1. Device Client A and Server B
2. Human A  via browser and Server B

All the scenarios you mention have been solved. You just need to know how.
X509 certs, the chain of trust, TPMs and HSMs are some the of parts of the 
solution for both types.

Internet Banking does exist.

John Orendt
john.p.ore...@medtronic.com

-Original Message-
From: Christopher Schultz 
Sent: Tuesday, January 18, 2022 11:32 AM
To: users@tomcat.apache.org
Subject: Re: Tomcat 9 Encrpytion of JDBC

John,

On 1/18/22 08:37, Orendt, John wrote:
> Secrets are more secure with the use of a Trusted Platform Module
> (TPM) and  / or a Hardware Security Module (HSM).
>
> Secrets need to be protected both at rest and in transit.
Sure. Where you put the password for the TPM or HSM? Or do you enter the 
password for your HSM/TPM every time you start a process that needs access to 
secrets? How do you handle unattended restarts?

How do you handle massive deployments? Do you manually-enter a password on 1000 
servers as they all launch together?

On all these kinds of deployments, you usually use a key server. But then how 
do you authenticate to the key server? With another secret.
It's secrets all the way down. At some point, you must trust something, and 
that something you trust can't be a human, because that doesn't scale or isn't 
practical for some other reason.

I'd love to hear a practical solution to the "secret at rest" problem that 
actually makes some sense and doesn't just hand-wave the problem off to another 
component that is Somebody Else's Problem.

-chris

> -Original Message-
> From: Alan F 
> Sent: Friday, January 14, 2022 2:05 PM
> To: Tomcat Users List 
> Subject: RE: Tomcat 9 Encrpytion of JDBC
>
> OK thanks Bill!
>
> -Original Message-
> From: Bill Stewart 
> Sent: 14 January 2022 19:02
> To: Tomcat Users List 
> Subject: Re: Tomcat 9 Encrpytion of JDBC
>
> On Fri, Jan 14, 2022 at 10:25 AM Alan F wrote:
>
>
>> Interested to know your best practices on securing jdbc plain text 
>> passwords, in my last place they used a mechanism to encrypt all passwords.
>> Is this the best method as I read some people don't recommend this.
>> Any details or procs on best practice appreciated.
>>
>
> The "best practice," generally speaking, is that doing so is basically 
> pointless from a security perspective.
>
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Furld
> efense.com%2Fv3%2F__https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisp
> ladata=04%7C01%7Charri.pesonen%40sinch.com%7C318adb49672e4fe13aa1
> 08d9dc2f9971%7C3b518aae89214a7b8497619d756ce20e%7C0%7C0%7C637782919266
> 275465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ
> BTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=mMjmECMDtbO%2Fa5ovQgdahIl
> aq%2FZdVBEnzoRAyy7oYQA%3Dreserved=0
> y/TOMCAT/Password__;!!NFcUtLLUcw!Bhr3E8c3AZFikCj4AHarnHl2emUxh99SUwhyn
> Fa-FKWZahvlpv0TmiVo5DveVMgMyg3NbQ$
>
> Bill
> [CONFIDENTIALITY AND PRIVACY NOTICE] Information transmitted by this 
> email is proprietary to Medtronic and is intended for use only by the 
> individual or entity to which it is addressed, and may contain 
> information that is private, privileged, confidential or exempt from 
> disclosure under applicable law. If you are not the intended recipient 
> or it appears that this mail has been forwarded to you without proper 
> authority, you are notified that any use or dissemination of this 
> information in any manner is strictly prohibited. In such cases, 
> please delete this mail from your records. To view this notice in 
> other languages you can either select the following link or manually 
> copy and paste the link into the address bar of a web browser:
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Femail
> disclaimer.medtronic.com%2Fdata=04%7C01%7Charri.pesonen%40sinch.c
> om%7C318adb49672e4fe13aa108d9dc2f9971%7C3b518aae89214a7b8497619d756ce2
> 0e%7C0%7C0%7C637782919266275465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj
> AwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=
> %2Fcv%2B6vRuz8ox1ipRnMTOWZxpz2%2BBKJ%2BHlfBh8iDg5m4%3Dreserved=0
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: 

Possible UpgradeInfo memory leak

2021-09-23 Thread Harri Pesonen
Hello, while looking at Tomcat 8.5.61 heap dump in VisualVM, in Dominators by 
Retained Size, two biggest ones are:

org.apache.tomcat.util.net.NioEndpoint#1  12 382 781 B (13,7%)
org.apache.coyote.http11.upgrade.UpgradeGroupInfo#1  7 066 212 B (7,8%)

I am wondering about UpgradeGroupInfo, because it has very large array of 
UpgradeInfos:

oname = javax.management.ObjectName#1240 : 
Catalina:Upgrade=websocket,name="https-jsse-nio-10.8.35.86-8443",type=GlobalRequestProcessor
 31 B (0%)  363 B (0%)
upgradeInfos = java.util.ArrayList#10079 : 146 098 elements 
20 B (0%)  7 066 144 B (7,8%)
elementData = java.lang.Object[]#22702 : 160 065 items   640 276 B (0,7%)   
 7 066 124 B (7,8%)
[0] = org.apache.coyote.http11.upgrade.UpgradeInfo#144 B (0%)  44 B 
(0%)

Single UpgradeInfo is very small, but there are 146 098 of them.
org.apache.coyote.http11.upgrade.UpgradeInfo   146 098 (12,8%)

I am not sure what this UpgradeInfo is, it looks like some statistics about 
upgraded connection, in this case from http to websocket.
To me it looks like these UpgradeInfos are not removed when connection is 
closed.
Any comments?

Thanks, Harri