Home > Net >  How to identify which version spring framework to use when upgrading java 1.7 webapp to openjdk 19?
How to identify which version spring framework to use when upgrading java 1.7 webapp to openjdk 19?

Time:01-25

Few years back, I develop a web application using Java 1.7, SpringFramework 4.1.1.RELEASE and Hibernate 3.6.10.Final. This webapp is running on Tomcat 7.0.4 at the time.

Now, I planning to upgrade and compile everything using OpenJDK 19, and Tomcat 10.1. How do I know which version to use in my pom.xml (Maven) so that theres no error after compilation and during runtime.

WHat should I do first?

Using the latest Eclipse and I have downloaded both Tomcat 10.1 and OpenJDK 19. I've set the Java Compiler to openJDK 19 and added both JRE System Library and Server Runtime in the build path. I have also added some more jar file to fix issues in Marker tab but I encountered error during starting up application.

CodePudding user response:

Tomcat 10.1 uses Servlet API 6.0 which is now part of Jakarta EE. As part of the move from Java EE to Jakarta EE, the packages in javax.servlet.* are moved to jakarta.servlet.* since the error you are getting.

If your target platform is Tomcat 10.1, you should move to Spring Framework 6.

Check the migration guide

  • Related