When compiled with java 7u79, spring 3.1 app is all good. When compiled on java 7u80, we're encountering some injection issues.
Searching a solution i found that Spring 3 is not compatible with java8, as explained here (due to asm).
We can see here that javac modifications were backported to java 7u80 and java 7u85.
So, am I rigth to think that it's same compatibility problem than for java 8, and that spring 3 app will not work if compiled on java7u80 ?
Sharing my experience - yes, some spring versions have problems with java 8. For example in my project we've had to change spring from 3.2.4 to 3.2.9 to use java 8. I won't put here any particular example because I don't have one but I would advice you to give spring 3.2.9 a chance. We're using it successfully with Java 8.
Related
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,
The application is created using spring boot version 1.2.5 Release. I can see that it includes an embedded tomcat version which is 8.0.23. Is it possible to upgrade to a recent tomcat version, let's say, tomcat 9 with spring boot 1.2.5 and still run the application? Or do we need to upgrade the spring boot version to be compatible with tomcat 9? Is there any documentation for the spring boot version compatibility with Tomcat? Thank you.
Why do you want to upgrade it? What is the newer version of tomcat going to bring?
I personally go with the defaults for the spring version unless there is a specific need or issue.
That being said this question may have some pointers
How to change embedded tomcat's version in existing spring boot app?
You may be able to just set the property
9.0.5
It would be preferable to upgrade to the latest Spring Boot release (currently 2.2.5-RELEASE) to avail yourself of the latest features. There are many tutorials, migration guides, problem solutions, etc., out there to guide you, of which here are just a couple:
https://spring.io/blog/2018/03/12/upgrading-start-spring-io-to-spring-boot-2
Global CORS configuration breaks when migrating to Spring Boot 2.0.x
You didn't specify a reason for keeping your Spring Boot version at 1.2.5-RELEASE and only upgrading tomcat, but if you really must, there are other answers, such as here: How to change embedded tomcat's version in existing spring boot app?
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.
What version of Java do you need to be able to use Spring 3.1.1. The geeks of Spring never put down in their documentation clearly what version is needed. Someone please help.
"
Java SE and Java EE Support
The Spring Framework is now based on Java 5, and Java 6 is fully supported.
Furthermore, Spring is compatible with J2EE 1.4 and Java EE 5, while at the same time introducing some early support for Java EE 6.
"
http://static.springsource.org/spring/docs/3.1.1.RELEASE/spring-framework-reference/html/new-in-3.0.html#new-in-3.0-intro
I'd like to take advantage of some JDK7 features. What issues might I run into given that I use Apache Tomcat 7.0.x (latest) and Spring 3.1 (latest)?
There were a few compilation gotchas where JDK 6 could infer the generic type properly where JDK 7 could not. This was apparently a bug in JDK 6 as referenced here.
If you are using container-specific resources (e.g., data sources, etc.) be sure to verify these are still operating properly (though this will be immediately obvious on Spring startup if any of these are wired in).
If you are using Spring Security, and you upgrade, you do not need to make any changes per se to get get things running. However, you should take advantage of their less verbose configuration options (especially for REST URL's) that are available in Spring Security 3.1.
Other than that, our upgrade was seamless.
With the last Ubuntu update (11.10) I switched to JDK 7 (OpenJDK 1.7.0_147). I'm using Spring 3.0, Tomcat 6, and JRE 6 on the server (we have both VM and "physical" server installations). The code, compiled with JDK 7 runs on this configuration without any problems. I'm sure, switching to Spring 3.1 won't cause any changes. Not so sure about Tomcat 7, but hopefully this information will be useful to you.
You might run into a problem if you're using Java 7 features in a JSP. Tomcat by default user Java 1.6 for JSP compilation. See http://tomcat.apache.org/tomcat-7.0-doc/jasper-howto.html#Production%20Configuration
To solve the problem you'll want to override the compilerSourceVM and compilerSourceVM init parameters in your application's web.xml file. More on that here: https://stackoverflow.com/a/20194823/1029261