Downgrade embedded tomcat version in maven - java

My Springboot application was build in tomcat 9.0 with java version of 1.8 and our server has tomcat 6 with java version of 1.7. I have already downgrade our java version in facet.
How can i downgrade the embedded tomcat in maven? Do I need to generate a new initialize from springIO?

From the SpringBoot docs:
Spring Boot 2.1.1.RELEASE requires Java 8 and is compatible up to Java
11 (included). Spring Framework 5.1.3.RELEASE or above is also
required.
https://docs.spring.io/spring-boot/docs/2.1.1.RELEASE/reference/htmlsingle/#getting-started-system-requirements
So if you must stay on 1.7 and Tomcat 6, you'll need to move away from SpringBoot and back to your older solutions.

Related

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

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.
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

SpringBoot 1.4.x compatibility with Java 11 [duplicate]

I'm using 1.4.1.RELEASE of spring-boot application. Everything was working ok for Java 8. However when I updated java version to 11 I can't run application using command mvn clean spring-boot:run. At the same time I can package is successfully (using mvn package). When I set java version to 8, it's working fine again.
[main] ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Restarter has not been initialized
at org.springframework.util.Assert.state(Assert.java:392)
at org.springframework.boot.devtools.restart.Restarter.getInstance(Restarter.java:545)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:48)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121)
at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:66)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
at com.myapp.Application.main(Application.java:24)
I can understand that newer versions of Spring might require newer version of Java. But it's not clear why older spring-boot can't be run on newer java versions.
The version of Spring Boot that you're using was released in September, 2016, long before Java 11 was released in September, 2018. I recommend you update to the latest version of Spring Boot, which is currently 2.1.9.
Please let me know if this fixes your issue; otherwise, we'll debug it further.
By default, Spring Boot 1.4.1.RELEASE requires Java 7 until Java 8 which is highly recommended and Spring Framework 4.3.3.RELEASE or above. If you want to use Java 11 with some version of Spring Boot, The latest version is recommended to use, then you should do a upgrade your project.
Although you can use Spring Boot with Java 6 or 7, we generally recommend Java 8 if at all possible.
System Requirements for Spring Boot 1.4.1
The version of Spring Boot which starts to use Java 11 it was 2.1.1 then you can use any up to this version.
Spring Boot 2.1.1.RELEASE requires Java 8 and is compatible up to Java 11 (included).
System Requirements for Spring Boot 2.1.1

What is the Maximum supported Spring Version with JDK 7

My project requires JDK 7 to build. What is the highest supported Spring version with JAVA 7 that can be used in my project? Is Spring 5.x supports java 7?
Is Spring 5.x supports java 7?
No, the minimum JDK version that you need for Spring 5.x is JDK 8. Given below is the list of JDK and Spring version mappings:
JDK Version Range
Spring Framework 5.3.x: JDK 8-17 (expected)
Spring Framework 5.2.x: JDK 8-15
Spring Framework 5.1.x: JDK 8-12
Spring Framework 5.0.x: JDK 8-10
Spring Framework 4.3.x: JDK 6-8
Check Spring Framework Versions for more details.

Older versions of spring boot fails to start on Java 11

I'm using 1.4.1.RELEASE of spring-boot application. Everything was working ok for Java 8. However when I updated java version to 11 I can't run application using command mvn clean spring-boot:run. At the same time I can package is successfully (using mvn package). When I set java version to 8, it's working fine again.
[main] ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Restarter has not been initialized
at org.springframework.util.Assert.state(Assert.java:392)
at org.springframework.boot.devtools.restart.Restarter.getInstance(Restarter.java:545)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:48)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121)
at org.springframework.boot.context.event.EventPublishingRunListener.contextLoaded(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.contextLoaded(SpringApplicationRunListeners.java:66)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
at com.myapp.Application.main(Application.java:24)
I can understand that newer versions of Spring might require newer version of Java. But it's not clear why older spring-boot can't be run on newer java versions.
The version of Spring Boot that you're using was released in September, 2016, long before Java 11 was released in September, 2018. I recommend you update to the latest version of Spring Boot, which is currently 2.1.9.
Please let me know if this fixes your issue; otherwise, we'll debug it further.
By default, Spring Boot 1.4.1.RELEASE requires Java 7 until Java 8 which is highly recommended and Spring Framework 4.3.3.RELEASE or above. If you want to use Java 11 with some version of Spring Boot, The latest version is recommended to use, then you should do a upgrade your project.
Although you can use Spring Boot with Java 6 or 7, we generally recommend Java 8 if at all possible.
System Requirements for Spring Boot 1.4.1
The version of Spring Boot which starts to use Java 11 it was 2.1.1 then you can use any up to this version.
Spring Boot 2.1.1.RELEASE requires Java 8 and is compatible up to Java 11 (included).
System Requirements for Spring Boot 2.1.1

migrating JDK 1.8 to JDK 1.9 for Spring 3.2 x framework based on large scale enterprise application

I have a spring 3.2.x application using iBATIS and tiles 3.0.x .it is running in JDK 1.8 without any issues.I am trying to migrate it to JDK 1.9.
If I migrate JDK 1.8 to JDK 1.9 What are the steps I need to follow?should I need to be upgrade spring 4.2.x jars?
should I need to be upgrade spring 4.2.x jars?
As far as i know Spring framework 5 released specially for java 9 with full compatibility. So you should use that for better results..!!

Categories

Resources