You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Greg Eschbacher <gr...@oracle.com.INVALID> on 2024/10/08 15:04:31 UTC

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

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

Re: [External] : Re: Issue with using tomcat-embed-core, JDK 11 and modules

Posted by Rémy Maucherat <re...@apache.org>.
On Wed, Oct 9, 2024 at 4:22 PM Greg Eschbacher
<gr...@oracle.com.invalid> wrote:
>
> Thank you very much Remy.  Your output below shows you using 9.0.96, and sure enough this was a problem in 9.0.95 but is fixed in 9.0.96.

I tried 9.0.96 because I had just released it. However it has no
relevant fixes and 9.0.95 work for me as well. I would say your maven
did not use the right annotations jar, for example the annotations jar
from 9.0.93 does not include the module info (due to the packaging
bug) and it could maybe do that.

Rémy

> Thanks,
> Greg
>
> ________________________________
> From: Rémy Maucherat <re...@apache.org>
> Sent: Wednesday, October 9, 2024 8:28 AM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: [External] : Re: Issue with using tomcat-embed-core, JDK 11 and modules
>
> On Tue, Oct 8, 2024 at 5:23 PM Greg Eschbacher
> <gr...@oracle.com.invalid> wrote:
> >
> > 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://urldefense.com/v3/__https://drive.google.com/file/d/1GwFLYRNol-zRL9vgg_ubsFcL2NWi9UmG/view?usp=drive_link__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCfqMPAjY$  .  (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://urldefense.com/v3/__https://www.mail-archive.com/users@tomcat.apache.org/msg143765.html__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCRPRO8ni$
>
> This is a packaging issue that is fixed in 9.0.93, it is not similar.
>
> Your test project works for me, so I don't have any ideas. Maven did
> download the proper tomcat-annotations-api.
>
> remm@feather:~/Work/tomcat/tests/simple-tomcat-project$ mvn package
> [INFO] Scanning for projects...
> [INFO]
> [INFO] -----------------< com.example:simple-tomcat-project >------------------
> [INFO] Building simple-tomcat-project 1.0-SNAPSHOT
> [INFO]   from pom.xml
> [INFO] --------------------------------[ jar ]---------------------------------
> Downloading from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCfuLXrv6$
> Downloaded from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCfuLXrv6$
> (1.7 kB at 4.8 kB/s)
> Downloading from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCXYAjrvZ$
> Downloaded from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCXYAjrvZ$
> (1.5 kB at 75 kB/s)
> Downloading from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCUsKMjsy$
> Downloaded from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCUsKMjsy$
> (3.6 MB at 11 MB/s)
> Downloading from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCd7Y_xAy$
> Downloaded from central:
> https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCd7Y_xAy$
> (13 kB at 667 kB/s)
>
> With 9.0.93 it fails (as expected) with "module not found:
> org.apache.tomcat.embed.core".
>
> Rémy
>
> > Thanks in advance for any suggestions on things to try.
> >
> >   *
> > Greg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: [External] : Re: Issue with using tomcat-embed-core, JDK 11 and modules

Posted by Greg Eschbacher <gr...@oracle.com.INVALID>.
Thank you very much Remy.  Your output below shows you using 9.0.96, and sure enough this was a problem in 9.0.95 but is fixed in 9.0.96.

Thanks,
Greg

________________________________
From: Rémy Maucherat <re...@apache.org>
Sent: Wednesday, October 9, 2024 8:28 AM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: [External] : Re: Issue with using tomcat-embed-core, JDK 11 and modules

On Tue, Oct 8, 2024 at 5:23 PM Greg Eschbacher
<gr...@oracle.com.invalid> wrote:
>
> 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://urldefense.com/v3/__https://drive.google.com/file/d/1GwFLYRNol-zRL9vgg_ubsFcL2NWi9UmG/view?usp=drive_link__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCfqMPAjY$  .  (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://urldefense.com/v3/__https://www.mail-archive.com/users@tomcat.apache.org/msg143765.html__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCRPRO8ni$

This is a packaging issue that is fixed in 9.0.93, it is not similar.

Your test project works for me, so I don't have any ideas. Maven did
download the proper tomcat-annotations-api.

remm@feather:~/Work/tomcat/tests/simple-tomcat-project$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< com.example:simple-tomcat-project >------------------
[INFO] Building simple-tomcat-project 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCfuLXrv6$
Downloaded from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCfuLXrv6$
(1.7 kB at 4.8 kB/s)
Downloading from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCXYAjrvZ$
Downloaded from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.pom__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCXYAjrvZ$
(1.5 kB at 75 kB/s)
Downloading from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCUsKMjsy$
Downloaded from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCUsKMjsy$
(3.6 MB at 11 MB/s)
Downloading from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCd7Y_xAy$
Downloaded from central:
https://urldefense.com/v3/__https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.jar__;!!ACWV5N9M2RV99hQ!KRBvIgokmvBd1aVvM0vbH9TfGPKUb9V19F0iBEPQb2krEaYSlz5szIeqUzlik5UNAMaq_27PCd7Y_xAy$
(13 kB at 667 kB/s)

With 9.0.93 it fails (as expected) with "module not found:
org.apache.tomcat.embed.core".

Rémy

> Thanks in advance for any suggestions on things to try.
>
>   *
> Greg

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


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

Posted by Rémy Maucherat <re...@apache.org>.
On Tue, Oct 8, 2024 at 5:23 PM Greg Eschbacher
<gr...@oracle.com.invalid> wrote:
>
> 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

This is a packaging issue that is fixed in 9.0.93, it is not similar.

Your test project works for me, so I don't have any ideas. Maven did
download the proper tomcat-annotations-api.

remm@feather:~/Work/tomcat/tests/simple-tomcat-project$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< com.example:simple-tomcat-project >------------------
[INFO] Building simple-tomcat-project 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.pom
Downloaded from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.pom
(1.7 kB at 4.8 kB/s)
Downloading from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.pom
Downloaded from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.pom
(1.5 kB at 75 kB/s)
Downloading from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.jar
Downloaded from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/embed/tomcat-embed-core/9.0.96/tomcat-embed-core-9.0.96.jar
(3.6 MB at 11 MB/s)
Downloading from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.jar
Downloaded from central:
https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-annotations-api/9.0.96/tomcat-annotations-api-9.0.96.jar
(13 kB at 667 kB/s)

With 9.0.93 it fails (as expected) with "module not found:
org.apache.tomcat.embed.core".

Rémy

> Thanks in advance for any suggestions on things to try.
>
>   *
> Greg

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