Issue with using tomcat-embed-core, JDK 11 and modules

2024-10-08 Thread Greg Eschbacher
Hi everyone,

Our application is upgrading from tomcat-embed-core 9.0.88 to 9.0.95, and we 
are having issues building with the latest jar.

We are getting issues related to JDK 11 and modules.  Specifically, when we 
build, we get the message " module not found: java.annotation "

To demonstrate this, I have created a sample project 
https://drive.google.com/file/d/1GwFLYRNol-zRL9vgg_ubsFcL2NWi9UmG/view?usp=drive_link
 .  (Just run "mvn clean package" with your JAVA_HOME set to JDK 11.  I'm using 
Oracle jdk-11.0.23)

By modifying the pom.xml and setting Tomcat to 9.0.88, it works fine.  9.0.95, 
it does not.  I've tried going through the commit history, but nothing stands 
out.

Note that a similar issue involving JDK 11 and modularity happened in this 
thread:  https://www.mail-archive.com/users@tomcat.apache.org/msg143765.html

Thanks in advance for any suggestions on things to try.

  *
Greg


Migrating from Tomcat 9.0.88 to Tomcat 10.1.30 on windows machine with JDK 21 LTS

2024-10-08 Thread Sajid Hussain

Hi,

I was using tomcat 9 with JDK 17 on windows. My java application was 
using 2.7.18. Now I'm migrating my application spring version to 3.3.4 
with Tomcat 10.1.30 and JDK 21. I have upgraded the version in my java 
project and fix the hibernate error migrating from 5 to 6. Now my 
application start on tomcat 10. But after few request JVM consume the 
maximum memory (I set it 3GB max) and cup usage to 90-98%. I set windows 
service priority to low and it take 80-90% hence my application stop 
responding. Here is the thread dum for the tomcat.Not getting any clue 
whats causing to tomcat high CPU and memory usage.




Regards,

Sajid Hussain

2024-10-08 16:18:31
Full thread dump OpenJDK 64-Bit Server VM (21.0.4+7-LTS mixed mode, sharing):

Threads class SMR info:
_java_thread_list=0x025908ea4a80, length=68, elements={
0x025918027d60, 0x025936946b90, 0x025936947c60, 0x025936a76260,
0x025936a770d0, 0x025936a78b40, 0x025936a7a1c0, 0x025936a7e450,
0x025936a86f00, 0x025936bcb150, 0x025936bce3c0, 0x02597c0ee270,
0x02597c781a70, 0x02597cd9e890, 0x02597cd9ef00, 0x02597cac8810,
0x02597cac8e80, 0x02597cac94f0, 0x02597cdafa10, 0x02597d099e60,
0x02597d098ab0, 0x02597d099140, 0x02597d0969e0, 0x02597d0997d0,
0x02597d097070, 0x02597d097d90, 0x02597d098420, 0x02597ca01370,
0x02597ca04160, 0x02597ca01a00, 0x02597c9fffc0, 0x02597ca06230,
0x02597ca05510, 0x02597ca00650, 0x02597ca068c0, 0x02597ca02090,
0x02597ca06f50, 0x02597ca00ce0, 0x0259029f8170, 0x0259000a0550,
0x0259000a1900, 0x0259029faf60, 0x0259029fbc80, 0x025936c4c640,
0x02590009fec0, 0x02590009ca40, 0x025936c4eda0, 0x0259029f7450,
0x0259029fea70, 0x02597d98ee70, 0x025936c4bfb0, 0x025936c49ee0,
0x02597d059ff0, 0x025936c4e080, 0x025936c4b920, 0x025936c4a570,
0x025936c4e710, 0x02597d9915d0, 0x02597d995770, 0x02597d98f500,
0x02597d990220, 0x02597cab46b0, 0x02597cab25e0, 0x02597cab4020,
0x02597caaf7f0, 0x02597caafe80, 0x02597cab4d40, 0x02597cab2c70
}

"main" #1 [10716] prio=5 os_prio=0 cpu=186312.50ms elapsed=546.21s 
tid=0x025918027d60 nid=10716 runnable  [0x0088cbbfe000]
   java.lang.Thread.State: RUNNABLE
at sun.nio.ch.Net.accept(java.base@21.0.4/Native Method)
at 
sun.nio.ch.NioSocketImpl.accept(java.base@21.0.4/NioSocketImpl.java:748)
at 
java.net.ServerSocket.implAccept(java.base@21.0.4/ServerSocket.java:698)
at 
java.net.ServerSocket.platformImplAccept(java.base@21.0.4/ServerSocket.java:663)
at 
java.net.ServerSocket.implAccept(java.base@21.0.4/ServerSocket.java:639)
at 
java.net.ServerSocket.implAccept(java.base@21.0.4/ServerSocket.java:585)
at java.net.ServerSocket.accept(java.base@21.0.4/ServerSocket.java:543)
at 
org.apache.catalina.core.StandardServer.await(StandardServer.java:557)
at org.apache.catalina.startup.Catalina.await(Catalina.java:847)
at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
at 
java.lang.invoke.LambdaForm$DMH/0x025938108c00.invokeVirtual(java.base@21.0.4/LambdaForm$DMH)
at 
java.lang.invoke.LambdaForm$MH/0x02593810ec00.invoke(java.base@21.0.4/LambdaForm$MH)
at 
java.lang.invoke.Invokers$Holder.invokeExact_MT(java.base@21.0.4/Invokers$Holder)
at 
jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(java.base@21.0.4/DirectMethodHandleAccessor.java:153)
at 
jdk.internal.reflect.DirectMethodHandleAccessor.invoke(java.base@21.0.4/DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke(java.base@21.0.4/Method.java:580)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)

   Locked ownable synchronizers:
- <0x0007867b7810> (a 
java.util.concurrent.locks.ReentrantLock$NonfairSync)

"Reference Handler" #9 [12400] daemon prio=10 os_prio=2 cpu=15.62ms 
elapsed=546.13s tid=0x025936946b90 nid=12400 waiting on condition  
[0x0088cc3ff000]
   java.lang.Thread.State: RUNNABLE
at 
java.lang.ref.Reference.waitForReferencePendingList(java.base@21.0.4/Native 
Method)
at 
java.lang.ref.Reference.processPendingReferences(java.base@21.0.4/Reference.java:246)
at 
java.lang.ref.Reference$ReferenceHandler.run(java.base@21.0.4/Reference.java:208)

   Locked ownable synchronizers:
- None

"Finalizer" #10 [15236] daemon prio=8 os_prio=1 cpu=0.00ms elapsed=546.13s 
tid=0x025936947c60 nid=15236 in Object.wait()  [0x0088cc4ff000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait0(java.base@21.0.4/Native Method)
- waiting on <0x000740800888> (a 
java.lang.ref.NativeReferenceQueue$Lock)
at java.lang.Object.wai

[ANN] Apache Tomcat 9.0.96 available

2024-10-08 Thread Rémy Maucherat
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 9.0.96.

Apache Tomcat 9 is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Unified Expression Language, Java
WebSocket and JASPIC technologies.

Apache Tomcat 9.0.96 is a bugfix and feature release. The notable
changes compared to 9.0.95 include:

- Multiple fixes and improvements for WebDAV.

- Improvements to the recently added request/response recycling for
   HTTP/2.

- Improve the stability of Tomcat Native during GC.

Along with lots of other bug fixes and improvements.

Please refer to the change log for the complete list of changes:
https://tomcat.apache.org/tomcat-9.0-doc/changelog.html

Downloads:
https://tomcat.apache.org/download-90.cgi

Migration guides from Apache Tomcat 7.x and 8.x:
https://tomcat.apache.org/migration.html

Enjoy!

- The Apache Tomcat team

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



Re: Migrating from Tomcat 9.0.88 to Tomcat 10.1.30 on windows machine with JDK 21 LTS

2024-10-08 Thread Mark Thomas

On 08/10/2024 05:21, Sajid Hussain wrote:

Hi,

I was using tomcat 9 with JDK 17 on windows. My java application was 
using 2.7.18. Now I'm migrating my application spring version to 3.3.4 
with Tomcat 10.1.30 and JDK 21. I have upgraded the version in my java 
project and fix the hibernate error migrating from 5 to 6. Now my 
application start on tomcat 10. But after few request JVM consume the 
maximum memory (I set it 3GB max) and cup usage to 90-98%. I set windows 
service priority to low and it take 80-90% hence my application stop 
responding. Here is the thread dum for the tomcat.Not getting any clue 
whats causing to tomcat high CPU and memory usage.


A profiler (I use YourKit because they give free licenses to OSS 
develoeprs but other profilers are avialable) will tell you more about 
what is going on than a single stack trace.


Is this a Spring Boot app? Is it packaged as a JAR or a WAR?

How are you running this as a Windows service? If you are using Apache 
Commons Daemon (the default way to run Tomcat as a Windows service) then 
this might be useful:

https://issues.apache.org/jira/projects/DAEMON/issues/DAEMON-460

Mark

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



AW: Migrating from Tomcat 9.0.88 to Tomcat 10.1.30 on windows machine with JDK 21 LTS

2024-10-08 Thread Thomas Hoffmann (Speed4Trade GmbH)
Hello Sajid,

> -Ursprüngliche Nachricht-
> Von: Sajid Hussain 
> Gesendet: Dienstag, 8. Oktober 2024 13:21
> An: users@tomcat.apache.org
> Betreff: Migrating from Tomcat 9.0.88 to Tomcat 10.1.30 on windows
> machine with JDK 21 LTS
> 
> Hi,
> 
> I was using tomcat 9 with JDK 17 on windows. My java application was using
> 2.7.18. Now I'm migrating my application spring version to 3.3.4 with Tomcat
> 10.1.30 and JDK 21. I have upgraded the version in my java project and fix the
> hibernate error migrating from 5 to 6. Now my application start on tomcat 10.
> But after few request JVM consume the maximum memory (I set it 3GB max)
> and cup usage to 90-98%. I set windows service priority to low and it take 80-
> 90% hence my application stop responding. Here is the thread dum for the
> tomcat.Not getting any clue whats causing to tomcat high CPU and memory
> usage.
> 
> 
> 
> Regards,
> 
> Sajid Hussain

the CPU usage is often high when the garbage collector can't free up sufficient 
memory.
The memory usage shows little spikes going up and down, like a little sawtooth 
in this case.
If this is the case, I would recommend creating a heap dump and analyze the 
dump, what is occupying the memory.
Eclipse MAT will assist you in analyzing the heap dump.

Greetings, Thomas