Hello! I would like to run Vaadin Flow on stable Debian. It has Tomcat 10 and Java 17. Vaadin Gradle Skeleton Starter works fine when I run ./gradlew appRun, but if I change the application server in build.gradle from jetty11 to tomcat10, I get the error:
SEVERE: Allocate exception for servlet [com.vaadin.flow.server.startup.ServletDeployer]
java.lang.ExceptionInInitializerError: Exception java.lang.NoSuchFieldError: JAVA_21 [in thread "main"]
at com.vaadin.copilot.Copilot.<clinit>(Copilot.java:28)
at com.vaadin.copilot.CopilotIndexHtmlLoader.serviceInit(CopilotIndexHtmlLoader.java:44)
at com.vaadin.flow.server.VaadinService.lambda$init$0(VaadinService.java:271)
...
Why does the problem occur on Tomcat 10 but not Jetty 11 and is there any way to disable Copilot?
You can exclude Copilot if you want, and that particular error should go away. However, the real problem causing the NoSuchFieldError is that somehow switching from Jetty to Tomcat introduces an older version of javaparser into the project. Not super clear why but I also see the issue
which is what causes the problem. Still not sure why that would be added to the tomcat container classpath but then it overrides the version in the application itself