Bug#1040226: tomcat10: deployment-time Java EE to Jakarta EE migration fails
Tamás J.Tóth
debreportbug at jnet.hu
Mon Jul 3 17:28:33 BST 2023
Package: tomcat10
Version: 10.1.10-1
Severity: important
X-Debbugs-Cc: debreportbug at jnet.hu
Dear Maintainer,
The deployment-time Java EE to Jakarta EE migration, as documented in
the Tomcat 10 migration guide
<https://tomcat.apache.org/migration-10.html#Specification_APIs>, fails
with `NoClassDefFoundError: org/apache/tomcat/jakartaee/Migration`. This
affects only those who use the deployment-time Java EE to Jakarta EE
migration, but makes this migration completely unusable.
Steps to reproduce:
1. Install Tomcat 10.
2. Put a web app in the `appBase` directory (/var/lib/tomcat10/webapps).
It can be very simple, e.g. a directory (say, test/) containing a
single index.html.
3. Start Tomcat.
4. Try to open the web app. Assuming you named the directory test/, it
should be at http://localhost:8080/test/.
5. Verify that it loads.
6. Move the web app to the `legacyAppBase` directory
(/var/lib/tomcat10/webapps-javaee) and restart Tomcat.
7. Try to open the web app again.
Actual result:
The web app doesn't load. The Tomcat log contains the following:
WARNING [main] org.apache.catalina.startup.HostConfig.migrateLegacyApp Migration failure
java.lang.NoClassDefFoundError: org/apache/tomcat/jakartaee/Migration
at org.apache.catalina.startup.HostConfig.migrateLegacyApp(HostConfig.java:1243)
at org.apache.catalina.startup.HostConfig$MigrateApp.run(HostConfig.java:1996)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
at org.apache.catalina.startup.HostConfig.migrateLegacyApps(HostConfig.java:1208)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:419)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1656)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
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.setState(LifecycleBase.java:366)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:893)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1328)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1318)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:428)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:919)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:482)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.jakartaee.Migration
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 35 more
Expected result:
The web app still loads.
-- System Information:
Debian Release: 12.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.1.0-9-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=C.UTF-8 (charmap=locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
Versions of packages tomcat10 depends on:
ii systemd [systemd-tmpfiles] 253.5-1
ii sysvinit-utils [lsb-base] 3.06-4
ii tomcat10-common 10.1.10-1
ii ucf 3.0043+nmu1
Versions of packages tomcat10 recommends:
pn libtcnative-1 <none>
Versions of packages tomcat10 suggests:
ii tomcat10-admin 10.1.10-1
pn tomcat10-docs <none>
pn tomcat10-examples <none>
pn tomcat10-user <none>
-- debconf information excluded
More information about the pkg-java-maintainers
mailing list