Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any issues migrating from JDK6 to JDK7 with Spring & Tomcat?

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)?

like image 679
at. Avatar asked Oct 15 '11 00:10

at.


Video Answer


2 Answers

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.

like image 63
Saish Avatar answered Sep 27 '22 22:09

Saish


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.

like image 22
weekens Avatar answered Sep 27 '22 23:09

weekens