Vaadin 8 with Jakarta

Hi,
i have legacy application with Vaadin 8 and started migration to Spring 6 and Jetty 12. Migration for higher versions of Vaadin are impossible for now. I would like to ask for some code snippet how to get working my code:

Best regards,
Tomo

You’ll need to update to the Extended Maintenance version of Vaadin 8 to use Spring 6 and Jakarta EE servlet. There are separate artifacts with Jakarta support such as vaadin-server-mpr-jakarta, vaadin-compatibility-server-mpr-jakarta and vaadin-push-jakarta in 8.27.0.

Okay, I only want to check how much efforts it will cost to rewrite our application… I have added dependencies You mentioned but I still get this compilation error. I don’t know how to connect ServletHolder with SpringVaadinServlet as it was working before increasing Jetty version.

Did you update your vaadin-spring dependency to 4.0.0?

There is a complete demo project here: GitHub - TatuLund/bakery-v8-sb3: Vaadin 8 Bakery demo using SpringBoot 3.2

It is a version of old Vaadin Bakery demo application modified to use Vaadin 8.27.0, Spring Boot 3.2, Vaadin Spring add-on 4.0.0, the latest Charts version and naturally Jakarta Servlet 6, Java 17 required.

Yes, i updated vaadin-spring dependency to 4.0.0. That demo project is not helpful cause we do not use Spring Boot but Spring with embedded Jetty and as i asked we need help with fixing Java based embedded Jetty-Vaadin configuration.

That question is actually not Vaadin specific. If you know how to configure Jetty 12 with Spring, then Vaadin 8 or Vaadin 24 both should work once the infrastructure just starts correctly. Just noting here, that in order to get this to work you need the Extended Maintenance license from Vaadin for Vaadin 8 use. The build will fail on license check error otherwise.

Nowadays almost no-one is using plain Spring, so it could be a bit difficult to find generic Spring 6 + Jetty 12 configuration example as the documentation exists primarily for Spring Boot. It sounds to me that your setup predates Spring Boot, as what you are doing is something Spring Boot is trying to be a standardized solution for. Hence one option for you would be to convert the application to use Spring Boot instead.

“Nowadays almost no-one is using plain Spring” - no comments

Spring Boot is not solution for every architecture.

It’s strickly Vaading specific question because our very large application (combining many different frameworks) works with Spring 5 but after upgrade to 6 only Vaadin causing problems. I pasted screen with configuration that worked for years but know is not compiling. It’s because your class extends javax servlet

You’re using the wrong dependency. Based on your screenshot, you have vaadin-server-8.27.3.jar whereas you should be using vaadin-server-mpr-jakarta if you are using Jakarta EE servlet. For the Vaadin 7 compatibility pack, there’s vaadin-compatibility-server-mpr-jakarta.

1 Like

Thank You very much! It works now :)