AW: 400 Bad Request - where do I find the detailed reason for the bad request so I can fix it?

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

> -Ursprüngliche Nachricht-
> Von: Graham Leggett 
> Gesendet: Dienstag, 28. November 2023 20:12
> An: Tomcat Users List 
> Betreff: Re: 400 Bad Request - where do I find the detailed reason for the
> bad request so I can fix it?
> 
> On 28 Nov 2023, at 18:42, Christopher Schultz 
> wrote:
> 
> > In your debugger, when you break-on-exception, what happens if you
> allow the exception to propagate up to the first exception-handler? Does
> Tomcat swallow the exception? Or it it caught elsewhere?
> 
> The exception eventually ends up inside ErrorReportValve, but I’m
> debugging a remote box and don’t have any of the source code tied up - will
> do further digging.
> 
> > When you say you have an "unmarshalling problem"... do you mean in your
> own application? Or something in Tomcat? (I can't think of anything in Tomcat
> we'd call "unmarshalling", but I figure I'd ask.)
> 
> I’m in dependency hell - java8 to java17, JAXB as used by Jersey2 broke. No
> idea why, but an internal Oracle implementation is hardcoded somewhere.
> 
> java.lang.ClassNotFoundException: oracle.xml.jaxp.JXSAXParserFactory

I think you got trapped in the javax-jakarta hell after upgrading.
As a general recommendation, you should upgrade all libraries in your app.
Mostly all new versions have switched to using Jakarta.

Do you use and build system like gradle or maven? 
They should take care of the new dependencies. Otherwise you have to look it up.

If some libraries don’t support Jakarta package yet, you have to add the legacy 
jaxb libs:
https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl

> Regards,
> Graham
> —



Re: webdav and libreoffice

2023-11-28 Thread Terence M. Bandoian
Have you tried with Tomcat 9.0.31 and Ubuntu 22.04?  Or Tomcat 9.0.31 
and CentOS 9?


-Terence

On 11/28/2023 9:00 PM, Jean-Max Reymond wrote:
Libreoffice cannot write the document with tomcat 9.0.58  and tomcat 
9.0.68, but it is ok with tomcat 9.0.31

debug mode shows a lot of PROPFIND but no crash.

Le 29/11/2023 à 00:53, Terence M. Bandoian a écrit :

What is the error?  Log?  Stack trace?

-Terence Bandoian

On 11/28/2023 4:27 PM, Jean-Max Reymond wrote:

Hi,
I have an application and a webdav servlet with tomcat.
I am using libreoffice to edit and save files.
the command is:
/usr/lib/libreoffice/program/soffice.bin 
ms-excel:ofe|u|https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls 
--splash-pipe=5


With tomcat 9.0.31 and Ubuntu 20.04, all is OK, editing and saving
With tomcat 9.0.58 and Ubuntu 22.04, failed to save the document 
with message : Error saving document Documents.xls
Unable to create object in directory 
https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls

With tomcat 9.0.69 and centos 9, same as tomcat 9.0.58

For all the tomcat versions, it is OK with MS Office (Word, Excel, ...)
What happens between  tomcat 9.0.31 and tomcat9.0.58 ?
Thanks for your tips,

-
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: webdav and libreoffice

2023-11-28 Thread Jean-Max Reymond
Libreoffice cannot write the document with tomcat 9.0.58  and tomcat 
9.0.68, but it is ok with tomcat 9.0.31

debug mode shows a lot of PROPFIND but no crash.

Le 29/11/2023 à 00:53, Terence M. Bandoian a écrit :

What is the error?  Log?  Stack trace?

-Terence Bandoian

On 11/28/2023 4:27 PM, Jean-Max Reymond wrote:

Hi,
I have an application and a webdav servlet with tomcat.
I am using libreoffice to edit and save files.
the command is:
/usr/lib/libreoffice/program/soffice.bin 
ms-excel:ofe|u|https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls --splash-pipe=5


With tomcat 9.0.31 and Ubuntu 20.04, all is OK, editing and saving
With tomcat 9.0.58 and Ubuntu 22.04, failed to save the document with 
message : Error saving document Documents.xls
Unable to create object in directory 
https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls

With tomcat 9.0.69 and centos 9, same as tomcat 9.0.58

For all the tomcat versions, it is OK with MS Office (Word, Excel, ...)
What happens between  tomcat 9.0.31 and tomcat9.0.58 ?
Thanks for your tips,

-
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: webdav and libreoffice

2023-11-28 Thread Terence M. Bandoian

What is the error?  Log?  Stack trace?

-Terence Bandoian

On 11/28/2023 4:27 PM, Jean-Max Reymond wrote:

Hi,
I have an application and a webdav servlet with tomcat.
I am using libreoffice to edit and save files.
the command is:
/usr/lib/libreoffice/program/soffice.bin 
ms-excel:ofe|u|https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls 
--splash-pipe=5


With tomcat 9.0.31 and Ubuntu 20.04, all is OK, editing and saving
With tomcat 9.0.58 and Ubuntu 22.04, failed to save the document with 
message : Error saving document Documents.xls
Unable to create object in directory 
https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls

With tomcat 9.0.69 and centos 9, same as tomcat 9.0.58

For all the tomcat versions, it is OK with MS Office (Word, Excel, ...)
What happens between  tomcat 9.0.31 and tomcat9.0.58 ?
Thanks for your tips,

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





webdav and libreoffice

2023-11-28 Thread Jean-Max Reymond

Hi,
I have an application and a webdav servlet with tomcat.
I am using libreoffice to edit and save files.
the command is:
/usr/lib/libreoffice/program/soffice.bin 
ms-excel:ofe|u|https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls 
--splash-pipe=5


With tomcat 9.0.31 and Ubuntu 20.04, all is OK, editing and saving
With tomcat 9.0.58 and Ubuntu 22.04, failed to save the document with 
message : Error saving document Documents.xls
Unable to create object in directory 
https://cloud.example.com/WebDav/NESTOR/GERARD/Documents.xls

With tomcat 9.0.69 and centos 9, same as tomcat 9.0.58

For all the tomcat versions, it is OK with MS Office (Word, Excel, ...)
What happens between  tomcat 9.0.31 and tomcat9.0.58 ?
Thanks for your tips,

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



Re: 400 Bad Request - where do I find the detailed reason for the bad request so I can fix it?

2023-11-28 Thread Graham Leggett
On 28 Nov 2023, at 19:11, Graham Leggett  wrote:

>> In your debugger, when you break-on-exception, what happens if you allow the 
>> exception to propagate up to the first exception-handler? Does Tomcat 
>> swallow the exception? Or it it caught elsewhere?
> 
> The exception eventually ends up inside ErrorReportValve, but I’m debugging a 
> remote box and don’t have any of the source code tied up - will do further 
> digging.

So the reason we get a 400 Bad Request with no error detail is that we arrive 
at this line with throwable set to null:

https://github.com/apache/tomcat/blob/9.0.x/java/org/apache/catalina/valves/ErrorReportValve.java#L129

With no throwable we are eventually led here, which is our generic “an error 
has occurred, not telling you what it is” page:

https://github.com/apache/tomcat/blob/9.0.x/java/org/apache/catalina/valves/ErrorReportValve.java#L169

Regards,
Graham
—



Tracking keep alive connections

2023-11-28 Thread Daniel Andres Pelaez Lopez
Hi community,

We have a heavy workload where the client uses a lot of keep-alive
connections, and we want to measure how many keep-alive connections
are open, but we cannot find metrics (MBean) with that information.
The closest one is tomcat_connections_keepalive_current but it seems
weird the data doesn't match, and tomcat_connections_current counts
everything.

>From this old post
(https://users.tomcat.apache.narkive.com/LbyzmDXn/how-to-get-the-number-of-keep-alive-connections),
it seems hard to measure it, so, do we have any other metrics that can
help? like tomcat_connections_closed or similar? maybe by knowing the
closed ones vs open ones, we can figure out the keep-alive ones.

Any insight will be appreciated.

-- 
Daniel Andrés Pelaez López

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



Re: 400 Bad Request - where do I find the detailed reason for the bad request so I can fix it?

2023-11-28 Thread Graham Leggett
On 28 Nov 2023, at 18:42, Christopher Schultz  
wrote:

> In your debugger, when you break-on-exception, what happens if you allow the 
> exception to propagate up to the first exception-handler? Does Tomcat swallow 
> the exception? Or it it caught elsewhere?

The exception eventually ends up inside ErrorReportValve, but I’m debugging a 
remote box and don’t have any of the source code tied up - will do further 
digging.

> When you say you have an "unmarshalling problem"... do you mean in your own 
> application? Or something in Tomcat? (I can't think of anything in Tomcat 
> we'd call "unmarshalling", but I figure I'd ask.)

I’m in dependency hell - java8 to java17, JAXB as used by Jersey2 broke. No 
idea why, but an internal Oracle implementation is hardcoded somewhere.

java.lang.ClassNotFoundException: oracle.xml.jaxp.JXSAXParserFactory

Regards,
Graham
—



Re: Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Simon Matter
Hi,

> Christoph,
>
> On 11/28/23 09:53, Christoph Kukulies wrote:
>> That was my connector:
>>
>>   >                 connectionTimeout="2"
>>                 redirectPort="8443" />
>>
>> I triednetstat -tulpn as well and it could be seen there was  no
>> listener under ip4 and port 8080.
>
> If you use the "address" attribute, you can pick the interface you will
> listen to:
>
> "
> [address]
>
> For servers with more than one IP address, this attribute specifies
> which address will be used for listening on the specified port. By
> default, the connector will listen all local addresses. Unless the JVM
> is configured otherwise using system properties, the Java based
> connectors (NIO, NIO2) will listen on both IPv4 and IPv6 addresses when
> configured with either 0.0.0.0 or ::. The APR/native connector will only
> listen on IPv4 addresses if configured with 0.0.0.0 and will listen on
> IPv6 addresses (and optionally IPv4 addresses depending on the setting
> of ipv6v6only) if configured with ::.
> " [1]
>
> You have not specified an "address", so you get the default which should
> be "all local addresses". You only showed your lsof output, so I
> couldn't see which interface you had been bound to.
>

Also, it's a question what the interface config looks like *exactly* at
the time when Tomcat was starting up. On systems running systemd it's easy
to get into troubles with the way systemd parallelizes the system startup.
Systemd service units often need additional tuning to result in reliable
startup order.

Regards,
Simon

>
> [1]
> https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Standard_Implementation
>
>>> Am 28.11.2023 um 15:15 schrieb Christopher Schultz
>>> mailto:ch...@christopherschultz.net>>:
>>>
>>> Christoph,
>>>
>>> On 11/28/23 08:26, Christoph Kukulies wrote:
 not that I kew of (changes in JVM arguments). I will try your
 suggestion:
 -Djava.net.preferIPv4Stack=true
 and thanks, it helped:
 I put it into /etc/defaults/tomcat9 (under Ubuntu 22.04)
 JAVA_OPTS="-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true"
 and now I have:
 root@mail:/etc/default# lsof -i :8080
 COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
 java    59579 tomcat   37u  IPv4 579485      0t0  TCP *:http-alt
 (LISTEN)
 root@mail:/etc/default#
>>>
>>> So... is that what you wanted?
>>>
>>> What does your  configuration look like?
>>>
>>> Try using netstat instead of lsof. It will show you the network
>>> interface being used as well as the port number and IP stack type.
>>>
>>> -chris
>>>
> Am 28.11.2023 um 13:58 schrieb Suvendu Sekhar Mondal
>   >:
>
> Hello Christoph,
>
> On Tue, Nov 28, 2023, 5:55 PM Christoph Kukulies
> mailto:k...@kukulies.org.invalid>>
> wrote:
>
>> I'm pulling my hairs on a suddenly occured - possibly -
>> misconfiguration.
>> But I can't find it out:
>>
>> catalina.2023-11-28.log:
>>
>>
>> 28-Nov-2023 13:15:43.742 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Server
>> version name:
>>  Apache Tomcat/9.0.58 (Ubuntu)
>> 28-Nov-2023 13:15:43.743 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Server built:
>>  Jan 6 1970 15:09:28 UTC
>> 28-Nov-2023 13:15:43.744 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Server version
>> number: 9.0.58.0
>> 28-Nov-2023 13:15:43.744 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log OS Name:
>>  Linux
>> 28-Nov-2023 13:15:43.744 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log OS Version:
>>  5.15.0-89-generic
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Architecture:
>>  amd64
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Java Home:
>>  /usr/lib/jvm/java-11-openjdk-amd64
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
>>  11.0.20.1+1-post-Ubuntu-0ubuntu122.04
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
>>  Ubuntu
>> 28-Nov-2023 13:15:43.746 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
>>  /var/lib/tomcat9
>> 28-Nov-2023 13:15:43.746 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
>>  /usr/share/tomcat9
>> 28-Nov-2023 13:15:43.758 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: --add-opens=java.base/java.lang=ALL-UNNAMED
>> 28-Nov-2023 13:15:43.759 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: --add-opens=java.base/java

Re: 400 Bad Request - where do I find the detailed reason for the bad request so I can fix it?

2023-11-28 Thread Christopher Schultz

Graham,

On 11/28/23 12:12, Graham Leggett wrote:

On 28 Nov 2023, at 09:41, Mark Thomas  wrote:


What do I need to do to see the exception that generated the bad request, so 
that I know specifically what’s wrong and can fix it?


Enabling debug logging for

org.apache.coyote.http11.Http11Processor may help.

It is probably the tightening up of the HTTP parsing that is triggering the 400 
response.


I eventually attached a remote debugger and stopped on all exceptions to get 
it. A problem with unmarshalling was being triggered then replaced with a 
generic 400. We’re now stuck on another bug, same symprom, this time a 500 with 
no exception.

What I’m finding is that the following valve on v9.0.65 has no effect:

 

Instead of rendering the exception in the output, we get the following:

HTTP Status 500 – Internal Server Errorbody {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 
{font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}HTTP Status 500 – Internal Server ErrorType Status ReportMessage Internal Server ErrorDescription The server encountered an unexpected condition that prevented it from fulfilling the request.Apache Tomcat/9.0.65

Is this a known problem?


In your debugger, when you break-on-exception, what happens if you allow 
the exception to propagate up to the first exception-handler? Does 
Tomcat swallow the exception? Or it it caught elsewhere?


When you say you have an "unmarshalling problem"... do you mean in your 
own application? Or something in Tomcat? (I can't think of anything in 
Tomcat we'd call "unmarshalling", but I figure I'd ask.)


-chris

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



Re: Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Christopher Schultz

Christoph,

On 11/28/23 09:53, Christoph Kukulies wrote:

That was my connector:

  

I triednetstat -tulpn as well and it could be seen there was  no 
listener under ip4 and port 8080.


If you use the "address" attribute, you can pick the interface you will 
listen to:


"
[address]

For servers with more than one IP address, this attribute specifies 
which address will be used for listening on the specified port. By 
default, the connector will listen all local addresses. Unless the JVM 
is configured otherwise using system properties, the Java based 
connectors (NIO, NIO2) will listen on both IPv4 and IPv6 addresses when 
configured with either 0.0.0.0 or ::. The APR/native connector will only 
listen on IPv4 addresses if configured with 0.0.0.0 and will listen on 
IPv6 addresses (and optionally IPv4 addresses depending on the setting 
of ipv6v6only) if configured with ::.

" [1]

You have not specified an "address", so you get the default which should 
be "all local addresses". You only showed your lsof output, so I 
couldn't see which interface you had been bound to.


-chris

[1] 
https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Standard_Implementation


Am 28.11.2023 um 15:15 schrieb Christopher Schultz 
mailto:ch...@christopherschultz.net>>:


Christoph,

On 11/28/23 08:26, Christoph Kukulies wrote:

not that I kew of (changes in JVM arguments). I will try your suggestion:
-Djava.net.preferIPv4Stack=true
and thanks, it helped:
I put it into /etc/defaults/tomcat9 (under Ubuntu 22.04)
JAVA_OPTS="-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true"
and now I have:
root@mail:/etc/default# lsof -i :8080
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    59579 tomcat   37u  IPv4 579485      0t0  TCP *:http-alt (LISTEN)
root@mail:/etc/default#


So... is that what you wanted?

What does your  configuration look like?

Try using netstat instead of lsof. It will show you the network 
interface being used as well as the port number and IP stack type.


-chris

Am 28.11.2023 um 13:58 schrieb Suvendu Sekhar Mondal 
 >:


Hello Christoph,

On Tue, Nov 28, 2023, 5:55 PM Christoph Kukulies 
mailto:k...@kukulies.org.invalid>>

wrote:

I'm pulling my hairs on a suddenly occured - possibly - 
misconfiguration.

But I can't find it out:

catalina.2023-11-28.log:


28-Nov-2023 13:15:43.742 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Server 
version name:

 Apache Tomcat/9.0.58 (Ubuntu)
28-Nov-2023 13:15:43.743 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Server built:
 Jan 6 1970 15:09:28 UTC
28-Nov-2023 13:15:43.744 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Server version
number: 9.0.58.0
28-Nov-2023 13:15:43.744 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log OS Name:
 Linux
28-Nov-2023 13:15:43.744 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log OS Version:
 5.15.0-89-generic
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Architecture:
 amd64
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Java Home:
 /usr/lib/jvm/java-11-openjdk-amd64
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
 11.0.20.1+1-post-Ubuntu-0ubuntu122.04
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
 Ubuntu
28-Nov-2023 13:15:43.746 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
 /var/lib/tomcat9
28-Nov-2023 13:15:43.746 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
 /usr/share/tomcat9
28-Nov-2023 13:15:43.758 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.lang=ALL-UNNAMED
28-Nov-2023 13:15:43.759 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.io =ALL-UNNAMED
28-Nov-2023 13:15:43.759 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.util=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument:
-Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties
28-Nov-2023 13:15:43.761 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

28-Nov-2023 13:15:43.761 INFO [main]
org.apache.

Re: 400 Bad Request - where do I find the detailed reason for the bad request so I can fix it?

2023-11-28 Thread Graham Leggett
On 28 Nov 2023, at 09:41, Mark Thomas  wrote:

>> What do I need to do to see the exception that generated the bad request, so 
>> that I know specifically what’s wrong and can fix it?
> 
> Enabling debug logging for
> 
> org.apache.coyote.http11.Http11Processor may help.
> 
> It is probably the tightening up of the HTTP parsing that is triggering the 
> 400 response.

I eventually attached a remote debugger and stopped on all exceptions to get 
it. A problem with unmarshalling was being triggered then replaced with a 
generic 400. We’re now stuck on another bug, same symprom, this time a 500 with 
no exception.

What I’m finding is that the following valve on v9.0.65 has no effect:



Instead of rendering the exception in the output, we get the following:

HTTP Status 500 – Internal Server 
Errorbody {font-family:Tahoma,Arial,sans-serif;} 
h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 
{font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} 
.line 
{height:1px;background-color:#525D76;border:none;}HTTP 
Status 500 – Internal Server ErrorType Status 
ReportMessage Internal Server ErrorDescription The 
server encountered an unexpected condition that prevented it from fulfilling 
the request.Apache Tomcat/9.0.65

Is this a known problem?

Regards,
Graham
—



Re: Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Shawn Heisey

On 11/28/23 05:24, Christoph Kukulies wrote:

root@mail:/var/lib/tomcat9/logs# lsof -i :8080
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    58986 tomcat   37u  IPv6 571175      0t0  TCP *:http-alt (LISTEN)
root@mail:/var/lib/tomcat9/logs#


On my local desktop (running Ubuntu 22), it says IPv6 but IPv4 works 
just fine:


sheisey@sheisey-desktop:~$ sudo lsof -Pn -i :81
COMMANDPID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
apache2   1681 root4u  IPv6  30968  0t0  TCP *:81 (LISTEN)
apache2 173394 www-data4u  IPv6  30968  0t0  TCP *:81 (LISTEN)
apache2 173395 www-data4u  IPv6  30968  0t0  TCP *:81 (LISTEN)
sheisey@sheisey-desktop:~$ ip a show br0
3: br0:  mtu 1500 qdisc noqueue state 
UP group default qlen 1000

link/ether be:3f:67:fc:ce:6b brd ff:ff:ff:ff:ff:ff
inet 192.168.217.210/24 brd 192.168.217.255 scope global dynamic 
noprefixroute br0

   valid_lft 2396sec preferred_lft 2396sec
inet6 fe80::bc3f:67ff:fefc:ce6b/64 scope link
   valid_lft forever preferred_lft forever
sheisey@sheisey-desktop:~$ telnet 192.168.217.210 81
Trying 192.168.217.210...
Connected to 192.168.217.210.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

I would suspect something like firewall/selinux/apparmor.  On this 
ubuntu desktop, ufw is disabled, so the connection also works from other 
systems on the LAN.


Thanks,
Shawn


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



[SECURITY] CVE-2023-46589 Apache Tomcat - Request Smuggling

2023-11-28 Thread Mark Thomas

CVE-2023-46589 Apache Tomcat - Request Smuggling

Severity: Important

Vendor: The Apache Software Foundation

Versions Affected:
Apache Tomcat 11.0.0-M1 to 11.0.0-M10
Apache Tomcat 10.1.0-M1 to 10.1.15
Apache Tomcat 9.0.0-M1 to 9.0.82
Apache Tomcat 8.5.0 to 8.5.95

Description:
Tomcat did not correctly parse HTTP trailer headers. A specially crafted 
trailer header that exceeded the header size limit could cause Tomcat to 
treat a single request as multiple requests leading to the possibility 
of request smuggling when behind a reverse proxy.


Mitigation:
Users of the affected versions should apply one of the following
mitigations:
- Upgrade to Apache Tomcat 11.0.0-M11 or later
- Upgrade to Apache Tomcat 10.1.16 or later
- Upgrade to Apache Tomcat 9.0.83 or later
- Upgrade to Apache Tomcat 8.5.96 or later

Credit:
This vulnerability was reported responsibly to the Tomcat security team 
by Norihito Aimoto (OSSTech Corporation).


History:
2023-11-28 Original advisory

References:
[1] https://tomcat.apache.org/security-11.html
[2] https://tomcat.apache.org/security-10.html
[3] https://tomcat.apache.org/security-9.html
[4] https://tomcat.apache.org/security-8.html

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



Re: Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Christoph Kukulies
Hi Christopher,

That was my connector:

 

I tried netstat -tulpn as well and it could be seen there was  no listener 
under ip4 and port 8080.

Thanks,

--
Christoph


> Am 28.11.2023 um 15:15 schrieb Christopher Schultz 
> :
> 
> Christoph,
> 
> On 11/28/23 08:26, Christoph Kukulies wrote:
>> not that I kew of (changes in JVM arguments). I will try your suggestion:
>> -Djava.net.preferIPv4Stack=true
>> and thanks, it helped:
>> I put it into /etc/defaults/tomcat9 (under Ubuntu 22.04)
>> JAVA_OPTS="-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true"
>> and now I have:
>> root@mail:/etc/default# lsof -i :8080
>> COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
>> java59579 tomcat   37u  IPv4 579485  0t0  TCP *:http-alt (LISTEN)
>> root@mail:/etc/default#
> 
> So... is that what you wanted?
> 
> What does your  configuration look like?
> 
> Try using netstat instead of lsof. It will show you the network interface 
> being used as well as the port number and IP stack type.
> 
> -chris
> 
>>> Am 28.11.2023 um 13:58 schrieb Suvendu Sekhar Mondal >> >:
>>> 
>>> Hello Christoph,
>>> 
>>> On Tue, Nov 28, 2023, 5:55 PM Christoph Kukulies >> >
>>> wrote:
>>> 
 I'm pulling my hairs on a suddenly occured - possibly - misconfiguration.
 But I can't find it out:
 
 catalina.2023-11-28.log:
 
 
 28-Nov-2023 13:15:43.742 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Server version name:
  Apache Tomcat/9.0.58 (Ubuntu)
 28-Nov-2023 13:15:43.743 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Server built:
  Jan 6 1970 15:09:28 UTC
 28-Nov-2023 13:15:43.744 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Server version
 number: 9.0.58.0
 28-Nov-2023 13:15:43.744 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log OS Name:
  Linux
 28-Nov-2023 13:15:43.744 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log OS Version:
  5.15.0-89-generic
 28-Nov-2023 13:15:43.745 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Architecture:
  amd64
 28-Nov-2023 13:15:43.745 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Java Home:
  /usr/lib/jvm/java-11-openjdk-amd64
 28-Nov-2023 13:15:43.745 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
  11.0.20.1+1-post-Ubuntu-0ubuntu122.04
 28-Nov-2023 13:15:43.745 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
  Ubuntu
 28-Nov-2023 13:15:43.746 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
  /var/lib/tomcat9
 28-Nov-2023 13:15:43.746 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
  /usr/share/tomcat9
 28-Nov-2023 13:15:43.758 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: --add-opens=java.base/java.lang=ALL-UNNAMED
 28-Nov-2023 13:15:43.759 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: --add-opens=java.base/java.io =ALL-UNNAMED
 28-Nov-2023 13:15:43.759 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: --add-opens=java.base/java.util=ALL-UNNAMED
 28-Nov-2023 13:15:43.760 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
 28-Nov-2023 13:15:43.760 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
 28-Nov-2023 13:15:43.760 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument:
 -Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties
 28-Nov-2023 13:15:43.761 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 28-Nov-2023 13:15:43.761 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: -Djava.awt.headless=true
 28-Nov-2023 13:15:43.761 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: -Djdk.tls.ephemeralDHKeySize=2048
 28-Nov-2023 13:15:43.761 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
 28-Nov-2023 13:15:43.762 INFO [main]
 org.apache.catalina.startup.VersionLoggerListener.log Command line
 argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
 28-Nov-2023 13:15:43.762 INFO [main]
 o

Re: Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Christopher Schultz

Christoph,

On 11/28/23 08:26, Christoph Kukulies wrote:

not that I kew of (changes in JVM arguments). I will try your suggestion:

-Djava.net.preferIPv4Stack=true

and thanks, it helped:

I put it into /etc/defaults/tomcat9 (under Ubuntu 22.04)

JAVA_OPTS="-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true"

and now I have:

root@mail:/etc/default# lsof -i :8080
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    59579 tomcat   37u  IPv4 579485      0t0  TCP *:http-alt (LISTEN)
root@mail:/etc/default#


So... is that what you wanted?

What does your  configuration look like?

Try using netstat instead of lsof. It will show you the network 
interface being used as well as the port number and IP stack type.


-chris

Am 28.11.2023 um 13:58 schrieb Suvendu Sekhar Mondal 
mailto:suv3...@gmail.com>>:


Hello Christoph,

On Tue, Nov 28, 2023, 5:55 PM Christoph Kukulies 
mailto:k...@kukulies.org.invalid>>

wrote:


I'm pulling my hairs on a suddenly occured - possibly - misconfiguration.
But I can't find it out:

catalina.2023-11-28.log:


28-Nov-2023 13:15:43.742 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Server version 
name:

 Apache Tomcat/9.0.58 (Ubuntu)
28-Nov-2023 13:15:43.743 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Server built:
 Jan 6 1970 15:09:28 UTC
28-Nov-2023 13:15:43.744 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Server version
number: 9.0.58.0
28-Nov-2023 13:15:43.744 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log OS Name:
 Linux
28-Nov-2023 13:15:43.744 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log OS Version:
 5.15.0-89-generic
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Architecture:
 amd64
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Java Home:
 /usr/lib/jvm/java-11-openjdk-amd64
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
 11.0.20.1+1-post-Ubuntu-0ubuntu122.04
28-Nov-2023 13:15:43.745 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
 Ubuntu
28-Nov-2023 13:15:43.746 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
 /var/lib/tomcat9
28-Nov-2023 13:15:43.746 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
 /usr/share/tomcat9
28-Nov-2023 13:15:43.758 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.lang=ALL-UNNAMED
28-Nov-2023 13:15:43.759 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.io =ALL-UNNAMED
28-Nov-2023 13:15:43.759 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.util=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument:
-Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties
28-Nov-2023 13:15:43.761 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

28-Nov-2023 13:15:43.761 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Djava.awt.headless=true
28-Nov-2023 13:15:43.761 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Djdk.tls.ephemeralDHKeySize=2048
28-Nov-2023 13:15:43.761 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
28-Nov-2023 13:15:43.762 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
28-Nov-2023 13:15:43.762 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Dignore.endorsed.dirs=
28-Nov-2023 13:15:43.762 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Dcatalina.base=/var/lib/tomcat9
28-Nov-2023 13:15:43.762 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Dcatalina.home=/usr/share/tomcat9
28-Nov-2023 13:15:43.763 INFO [main]
org.apache.catalina.startup.VersionLoggerListener.log Command line
argument: -Djava.io.tmpdir=/tmp
28-Nov-2023 13:15:43.768 INFO [main]
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded 
Apache

Tomcat Native library [1.2.31] us

Re: Datadog _ JMX Integration facing connection issues.

2023-11-28 Thread Christopher Schultz

Sai Vamsi,

On 11/28/23 04:29, Bodavula, Sai Vamsi Mohan Krishna (TR Technology) wrote:

Hello team,
I am trying to add Tomcat-JMX Integration to the Datadog Agent, in order 
to achieve Remote Monitoring .
I am following the docs 
https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm#autodiscovery-annotations 


*_This is the Environment  I am using in my case._*
I am trying to integrate JMX in one my Deployment, in AKS environment 
and I am using Helm to upgrade my environment.
as suggested in the documentation., I am adding the annotations in my 
deployment file in helm structure.

My agent is JMX enabled, and i can see in deployment logs.
I have configured a service for this deployment and its reflecting.


*_Issue I am facing :_*
  I am trying to add my annotations, in the deployment file, after 
deployment, it should be able make the remote connection , but its 
showing  these logs in the agent.
while i check the Java process., even its not reflecting this JMX 
process , it seems JMX process is not at all created, in my case.,

*
*
*_Following are the annotations i am using in my case

_*
Even i tried by altering some of the unwanted annotations, I am not 
getting the expected result., ie., remote JMX connection.,


I'm sorry, but this list does not allow attached or embedded images. Can 
you copy/paste your logs into the text and try again?


-chris

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



Re: Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Christoph Kukulies
Hi Suvendu,

not that I kew of (changes in JVM arguments). I will try your suggestion:

-Djava.net.preferIPv4Stack=true

and thanks, it helped:

I put it into /etc/defaults/tomcat9 (under Ubuntu 22.04)

JAVA_OPTS="-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true"

and now I have:

root@mail:/etc/default# lsof -i :8080
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java59579 tomcat   37u  IPv4 579485  0t0  TCP *:http-alt (LISTEN)
root@mail:/etc/default# 

--
Christoph


> Am 28.11.2023 um 13:58 schrieb Suvendu Sekhar Mondal :
> 
> Hello Christoph,
> 
> On Tue, Nov 28, 2023, 5:55 PM Christoph Kukulies  >
> wrote:
> 
>> I'm pulling my hairs on a suddenly occured - possibly - misconfiguration.
>> But I can't find it out:
>> 
>> catalina.2023-11-28.log:
>> 
>> 
>> 28-Nov-2023 13:15:43.742 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Server version name:
>>  Apache Tomcat/9.0.58 (Ubuntu)
>> 28-Nov-2023 13:15:43.743 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Server built:
>>  Jan 6 1970 15:09:28 UTC
>> 28-Nov-2023 13:15:43.744 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Server version
>> number: 9.0.58.0
>> 28-Nov-2023 13:15:43.744 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log OS Name:
>>  Linux
>> 28-Nov-2023 13:15:43.744 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log OS Version:
>>  5.15.0-89-generic
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Architecture:
>>  amd64
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Java Home:
>>  /usr/lib/jvm/java-11-openjdk-amd64
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
>>  11.0.20.1+1-post-Ubuntu-0ubuntu122.04
>> 28-Nov-2023 13:15:43.745 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
>>  Ubuntu
>> 28-Nov-2023 13:15:43.746 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
>>  /var/lib/tomcat9
>> 28-Nov-2023 13:15:43.746 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
>>  /usr/share/tomcat9
>> 28-Nov-2023 13:15:43.758 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: --add-opens=java.base/java.lang=ALL-UNNAMED
>> 28-Nov-2023 13:15:43.759 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: --add-opens=java.base/java.io=ALL-UNNAMED
>> 28-Nov-2023 13:15:43.759 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: --add-opens=java.base/java.util=ALL-UNNAMED
>> 28-Nov-2023 13:15:43.760 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
>> 28-Nov-2023 13:15:43.760 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
>> 28-Nov-2023 13:15:43.760 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument:
>> -Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties
>> 28-Nov-2023 13:15:43.761 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>> 28-Nov-2023 13:15:43.761 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Djava.awt.headless=true
>> 28-Nov-2023 13:15:43.761 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Djdk.tls.ephemeralDHKeySize=2048
>> 28-Nov-2023 13:15:43.761 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
>> 28-Nov-2023 13:15:43.762 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
>> 28-Nov-2023 13:15:43.762 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Dignore.endorsed.dirs=
>> 28-Nov-2023 13:15:43.762 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Dcatalina.base=/var/lib/tomcat9
>> 28-Nov-2023 13:15:43.762 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Dcatalina.home=/usr/share/tomcat9
>> 28-Nov-2023 13:15:43.763 INFO [main]
>> org.apache.catalina.startup.VersionLoggerListener.log Command line
>> argument: -Djava.io.tmpdir=/tmp
>> 28-Nov-2023 13:15:43.768 INFO [main]
>> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache
>> Tomcat Native library [1.2.31] using APR version [1.7.

Re: Performance tuning embedded Tomcat 10.1.7: High requests/second, HTTPs and a lot of keep alive connections

2023-11-28 Thread Daniel Andres Pelaez Lopez
Thanks chris for your thoughts.

> This is obviously a "big" question whose answer likely take months to
> really determine. But we can get started :)

I am aware the question is too broad but better to ask than to be
silent. Will try to go for increasing maxKeepAliveRequests first and
see where that moves us.

> I'm curious: did you experience any significant change in performing
> and/or CPU usage when switching to Virtual Threads?

The load tests we performed showed us virtual threads overperform
platform threads for the constrained environment we have, where only
one Tomcat instance is used, and a shared machine with other
processes. We tried increasing the platform thread pool as much as we
could, but there was a limit where no more threads helped at all, the
context switch was eating the performance. We have seen 5000
requests/second with good latency for getting a small file from
memory. When the load is high, virtual threads start to eat a lot of
CPU, but, we notice that the limit for that is higher than for
platform threads, where the CPU starts to increase pretty soon
alongside memory. We have been using virtual threads from JDK 19 as a
preview on production code and no issues at all.

--
Daniel Andrés Pelaez López

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



Re: Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Suvendu Sekhar Mondal
Hello Christoph,

On Tue, Nov 28, 2023, 5:55 PM Christoph Kukulies 
wrote:

> I'm pulling my hairs on a suddenly occured - possibly - misconfiguration.
> But I can't find it out:
>
> catalina.2023-11-28.log:
>
>
> 28-Nov-2023 13:15:43.742 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Server version name:
>   Apache Tomcat/9.0.58 (Ubuntu)
> 28-Nov-2023 13:15:43.743 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Server built:
>   Jan 6 1970 15:09:28 UTC
> 28-Nov-2023 13:15:43.744 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Server version
> number: 9.0.58.0
> 28-Nov-2023 13:15:43.744 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log OS Name:
>   Linux
> 28-Nov-2023 13:15:43.744 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log OS Version:
>   5.15.0-89-generic
> 28-Nov-2023 13:15:43.745 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Architecture:
>   amd64
> 28-Nov-2023 13:15:43.745 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Java Home:
>   /usr/lib/jvm/java-11-openjdk-amd64
> 28-Nov-2023 13:15:43.745 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log JVM Version:
>   11.0.20.1+1-post-Ubuntu-0ubuntu122.04
> 28-Nov-2023 13:15:43.745 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
>   Ubuntu
> 28-Nov-2023 13:15:43.746 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:
>   /var/lib/tomcat9
> 28-Nov-2023 13:15:43.746 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:
>   /usr/share/tomcat9
> 28-Nov-2023 13:15:43.758 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: --add-opens=java.base/java.lang=ALL-UNNAMED
> 28-Nov-2023 13:15:43.759 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: --add-opens=java.base/java.io=ALL-UNNAMED
> 28-Nov-2023 13:15:43.759 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: --add-opens=java.base/java.util=ALL-UNNAMED
> 28-Nov-2023 13:15:43.760 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
> 28-Nov-2023 13:15:43.760 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
> 28-Nov-2023 13:15:43.760 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument:
> -Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties
> 28-Nov-2023 13:15:43.761 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> 28-Nov-2023 13:15:43.761 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Djava.awt.headless=true
> 28-Nov-2023 13:15:43.761 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Djdk.tls.ephemeralDHKeySize=2048
> 28-Nov-2023 13:15:43.761 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
> 28-Nov-2023 13:15:43.762 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
> 28-Nov-2023 13:15:43.762 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Dignore.endorsed.dirs=
> 28-Nov-2023 13:15:43.762 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Dcatalina.base=/var/lib/tomcat9
> 28-Nov-2023 13:15:43.762 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Dcatalina.home=/usr/share/tomcat9
> 28-Nov-2023 13:15:43.763 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Djava.io.tmpdir=/tmp
> 28-Nov-2023 13:15:43.768 INFO [main]
> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache
> Tomcat Native library [1.2.31] using APR version [1.7.0].
> 28-Nov-2023 13:15:43.769 INFO [main]
> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR
> capabilities: IPv6 [true], sendfile [true], accept filters [false], random
> [true], UDS [true].
> 28-Nov-2023 13:15:43.771 INFO [main]
> org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL
> configuration: useAprConnector [false], useOpenSSL [true]
> 28-Nov-2023 13:15:43.776 INFO [main]
> org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL
> successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
> 28-Nov-2023 13:15:44.229 INFO [main]
> org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler
> ["http-nio-8080"]
> 28-Nov-202

Tomcat9 not listening to ipv4 port 8080, only ipv6

2023-11-28 Thread Christoph Kukulies
I'm pulling my hairs on a suddenly occured - possibly - misconfiguration. But I 
can't find it out:

catalina.2023-11-28.log:


28-Nov-2023 13:15:43.742 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server version name:   
Apache Tomcat/9.0.58 (Ubuntu)
28-Nov-2023 13:15:43.743 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server built:  
Jan 6 1970 15:09:28 UTC
28-Nov-2023 13:15:43.744 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server version number: 
9.0.58.0
28-Nov-2023 13:15:43.744 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Name:   
Linux
28-Nov-2023 13:15:43.744 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Version:
5.15.0-89-generic
28-Nov-2023 13:15:43.745 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Architecture:  
amd64
28-Nov-2023 13:15:43.745 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Java Home: 
/usr/lib/jvm/java-11-openjdk-amd64
28-Nov-2023 13:15:43.745 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Version:   
11.0.20.1+1-post-Ubuntu-0ubuntu122.04
28-Nov-2023 13:15:43.745 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:
Ubuntu
28-Nov-2023 13:15:43.746 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: 
/var/lib/tomcat9
28-Nov-2023 13:15:43.746 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: 
/usr/share/tomcat9
28-Nov-2023 13:15:43.758 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
--add-opens=java.base/java.lang=ALL-UNNAMED
28-Nov-2023 13:15:43.759 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
--add-opens=java.base/java.io=ALL-UNNAMED
28-Nov-2023 13:15:43.759 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
--add-opens=java.base/java.util=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
28-Nov-2023 13:15:43.760 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djava.util.logging.config.file=/var/lib/tomcat9/conf/logging.properties
28-Nov-2023 13:15:43.761 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Nov-2023 13:15:43.761 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djava.awt.headless=true
28-Nov-2023 13:15:43.761 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djdk.tls.ephemeralDHKeySize=2048
28-Nov-2023 13:15:43.761 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djava.protocol.handler.pkgs=org.apache.catalina.webresources
28-Nov-2023 13:15:43.762 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Dorg.apache.catalina.security.SecurityListener.UMASK=0027
28-Nov-2023 13:15:43.762 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Dignore.endorsed.dirs=
28-Nov-2023 13:15:43.762 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Dcatalina.base=/var/lib/tomcat9
28-Nov-2023 13:15:43.762 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Dcatalina.home=/usr/share/tomcat9
28-Nov-2023 13:15:43.763 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line argument: 
-Djava.io.tmpdir=/tmp
28-Nov-2023 13:15:43.768 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache 
Tomcat Native library [1.2.31] using APR version [1.7.0].
28-Nov-2023 13:15:43.769 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: 
IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
28-Nov-2023 13:15:43.771 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL 
configuration: useAprConnector [false], useOpenSSL [true]
28-Nov-2023 13:15:43.776 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL 
successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
28-Nov-2023 13:15:44.229 INFO [main] org.apache.coyote.AbstractProtocol.init 
Initializing ProtocolHandler ["http-nio-8080"]
28-Nov-2023 13:15:44.268 INFO [main] org.apache.catalina.startup.Catalina.load 
Server initialization in [799] milliseconds
28-Nov-2023 13:15:44.328 IN

Re: 400 Bad Request - where do I find the detailed reason for the bad request so I can fix it?

2023-11-28 Thread Mark Thomas

On 27/11/2023 20:09, Graham Leggett wrote:

Hi all,

Long running webapps, tomcat recently updated from tomcat7 to tomcat v9.0.65. 
One webapp sends a request to another.

The request fails with a 400 Bad Request, with the detail message "The server 
cannot or will not process the request due to something that is perceived to be a 
client error (e.g., malformed request syntax, invalid request message framing, or 
deceptive request routing).”

I am aware what a 400 bad request is, however the message above gives me an 
incomplete list of possible reasons for the bad request, rather than the actual 
specific reason for this specific bad request. Google is filled with generic 
results, and is of no help.

What do I need to do to see the exception that generated the bad request, so 
that I know specifically what’s wrong and can fix it?


Enabling debug logging for

org.apache.coyote.http11.Http11Processor may help.

It is probably the tightening up of the HTTP parsing that is triggering 
the 400 response.


Mark

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



Datadog _ JMX Integration facing connection issues.

2023-11-28 Thread Bodavula, Sai Vamsi Mohan Krishna (TR Technology)
Hello team,
I am trying to add Tomcat-JMX Integration to the Datadog Agent, in order to 
achieve Remote Monitoring .
I am following the docs 
https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=helm#autodiscovery-annotations

This is the Environment  I am using in my case.
I am trying to integrate JMX in one my Deployment, in AKS environment and I am 
using Helm to upgrade my environment.
as suggested in the documentation., I am adding the annotations in my 
deployment file in helm structure.
My agent is JMX enabled, and i can see in deployment logs.
I have configured a service for this deployment and its reflecting.


Issue I am facing :
 I am trying to add my annotations, in the deployment file, after deployment, 
it should be able make the remote connection , but its showing  these logs in 
the agent.
while i check the Java process., even its not reflecting this JMX process , it 
seems JMX process is not at all created, in my case.,
[cid:5a307d04-216c-42b5-9e74-0b23df59b803]

Following are the annotations i am using in my case

[cid:40751353-de64-4b88-a04b-7fda70f9cc5c]
[cid:208606f4-1e69-4e53-b191-ce2254e9352d]
Even i tried by altering some of the unwanted annotations, I am not getting the 
expected result., ie., remote JMX connection.,


I would requet your help in this.,
Thanks in advance!


Thanks & Regards,
--

SAI VAMSI .B
Senior DevOps Engineer

This e-mail is for the sole use of the intended recipient and contains 
information that may be privileged and/or confidential. If you are not an 
intended recipient, please notify the sender by return e-mail and delete this 
e-mail and any attachments. Certain required legal entity disclosures can be 
accessed on our website: 
https://www.thomsonreuters.com/en/resources/disclosures.html