I have developed some rest services with Spring mvc 3.0.9. In some case I have an exception. It depends that my spring version use Servlet 3.0 api (my application server is jboss eap 5.1). What is latest spring mvc version compatible with Servlet 2.5? Thanks.
Spring 3.2 should work with Servlet 2.5 API.
Only Spring 4.0 requires Serlvet 3.0:
refer this official documentation for more info.
3 New Features and Enhancements in Spring Framework 4.0)
3.4 Java EE 6 and 7
Java EE version 6 or above is now considered the baseline for Spring
Framework 4, with the JPA 2.0 and Servlet 3.0 specifications being of
particular relevance.
Spring 4.0 work with Servlet 2.5.
See document: (https://docs.spring.io/spring/docs/4.3.14.RELEASE/spring-framework-reference/htmlsingle/)
3.4 Java EE 6 and 7
Java EE version 6 or above is now considered the baseline for Spring
Framework 4, with the JPA 2.0 and Servlet 3.0 specifications being of
particular relevance. In order to remain compatible with Google App
Engine and older application servers, it is possible to deploy a
Spring 4 application into a Servlet 2.5 environment. However, Servlet
3.0+ is strongly recommended and a prerequisite in Spring’s test and mock packages for test setups in development environments.
3.7 General Web Improvements
Deployment to Servlet 2.5 servers remains an option, but Spring
Framework 4.0 is now focused primarily on Servlet 3.0+ environments.
If you are using the Spring MVC Test Framework you will need to ensure
that a Servlet 3.0 compatible JAR is in your test classpath.
Related
The Problem
We currently have a Spring MVC application (non-spring-boot) based on Spring 5 and Hibernate 5. We have to migrate the app to Hibernate 6.1.
During testing we are encountering exceptions once upgraded to Hibernate 6.1. The root cause exception
java.lang.NoClassDefFoundError:
Could not initialize class org.springframework.orm.hibernate5.LocalSessionFactoryBuilder
Is Spring 5 compatible with Hibernate 6.1? I checked the Spring.io website but could not find any compatibility information for spring-orm.
What I Expected
I expected the application to work with Hibernate 6.1 upgrade.
Environment
Spring MVC 5.3.21 (non-spring-boot)
Hibernate 6.1.0
Tomcat 9.0.64
Java 13
Ubuntu 20
Research Performed
I checked the spring.io website and reference manual. I could not find compatibility information for spring-orm and Hibernate 6.1
How to Reproduce
Deploy a Spring MVC web app (non-spring-boot) that uses Spring 5.3.21 and Hibernate 6.1
what is the spring-web module version compatible with tomcat 10?
Spring web Application is running on tomcat 9.x and its fail with ClassCastException ad tomcat 10 using jakarta API.
java.lang.ClassCastException: org.springframework.web.filter.DelegatingFilterProxy cannot be cast to jakarta.servlet.Filter
There is none, currently, none of the spring 5 versions support Jakarta packages.
They did say however that in version 6 they will tho, but for now it supports Javax packages.
There might be some workaround, I know I had to test if Spring 4 works with JDK11, it does, but Spring suggests using Spring 5 for JDK11.
For Spring MVC 5, the Spring MVC DispatcherServlet has a dependency on the javax.servlet.* package namespace. This is using the Java EE 8 javax package naming. Since Tomcat 10 is based on Jakarta EE 9, the packages for javax naming are not supported. This explains why Spring MVC 5 does not work on Tomcat 10.
https://github.com/spring-projects/spring-boot/issues/25276
We have a lot of spring code written in our AEM application. We are using spring dm to run the code in osgi.
Now we would like to migrate our code to JDK 11 which requires us to migrate spring framework to 5.1 onwards. Is there a spring dm version with support springframework 5.1 onwards.
Are there any other alternative approaches to do such migration ??
regards,
Is there any way to develop spring based restful end point using jdk1.4(non annotation base approach because java 1.4 won't support) ?
I have oc4j server(oracle application server) version 10.1.3 which supports j2sdk 1.4 and servlet 2.4. I believe I won't be able to deploy a springboot restful web service in my oc4j server because of jdk1.4(minimum java version required for springboot is 1.6)
Yes I agree Spring Boot is not possible for my scenario. I am asking if it is possible to develop spring web-mvc using jdk 1.4 and servlet 2.4 version ?
You may need to use the XML based configurations for initializing spring context. A RESTful application can be built even without using Spring using Jersey or some other JAX-RS implementations, if you are not going to use any Spring capabilities.
I am looking to create a new web application using spring boot. Unfortunately my server is fairly locked down in terms of the technology stack. It has java 5 installed on it.
Can anyone tell me whether spring boot can run on java 1.5 and what version?
thanks
Since Spring boot 1.0.0, the minimal requirement to run a Spring boot application has been Java 6. This can also be found in the reference guide of Spring boot 1.0.0:
Spring Boot can be used with “classic” Java development tools or installed as a command line tool. Regardless, you will need Java SDK v1.6 or higher.
Support for older Java versions has been dropped throughout releases, with Spring boot 1.3 moving to Java 7 as a baseline (still possible to use Java 6 with additional configuration) and Spring boot 2.x moving to Java 8 as a baseline. Additionally to what the documentation says, none of the Spring boot 1.x versions support Java 9 or higher.
Summarized:
1.0.0: Support from Java 6 - 8
1.3.0: Support from Java 7 - 8, additional configuration for Java 6 required
2.0.0: Support from Java 8 - ...
So, the answer is that it's not possible to run in Java 5.
For Spring Boot 2.0, the requirement is Java 8 as a minimum version.
From the Spring Boot 2.0 release notes :
Spring Boot 2.0 requires Java 8 as a minimum version. Many existing
APIs have been updated to take advantage of Java 8 features such as:
default methods on interfaces, functional callbacks, and new APIs such
as javax.time. If you are currently using Java 7 or earlier, you’ll
need to upgrade your JDK before you can develop Spring Boot 2.0
applications.