Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document minimum JDK 8 update version #23563

Closed
crosslover opened this issue Sep 2, 2019 · 3 comments
Closed

Document minimum JDK 8 update version #23563

crosslover opened this issue Sep 2, 2019 · 3 comments
Assignees
Labels
type: documentation A documentation task
Milestone

Comments

@crosslover
Copy link

crosslover commented Sep 2, 2019

  • surefire: 2.20.1
  • jdk: 1.8.0_45
  • Spring: 5.0.15.RELEASE
  • mvn: 3.6.1

When I run mvn test with the maven-surefire-plugin, this happens:

[2019-09-02T09:28:48.807Z] java.lang.IllegalStateException: Failed to load ApplicationContext

[2019-09-02T09:28:48.807Z] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is java.lang.BootstrapMethodError: call site initialization exception

[2019-09-02T09:28:48.807Z] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is java.lang.BootstrapMethodError: call site initialization exception

[2019-09-02T09:28:48.807Z] Caused by: java.lang.BootstrapMethodError: call site initialization exception

[2019-09-02T09:28:48.807Z] Caused by: java.lang.ClassCastException: Cannot cast org.springframework.http.converter.xml.SourceHttpMessageConverter$$Lambda$81/217380081 to org.xml.sax.EntityResolver

mvn clean test -U -X -T 4

the error code slice:

public class SourceHttpMessageConverter<T extends Source> extends AbstractHttpMessageConverter<T> {

	private static final EntityResolver NO_OP_ENTITY_RESOLVER =
			(publicId, systemId) -> new InputSource(new StringReader(""));

However, when I used the jdk of version jdk1.8.0_211, it didn't happen any more. It probably could be caused by jdk type inference mechanism(which may be fixed in later version) under the surefire class loader.

Just report the issue, btw are there some documents related to it?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 2, 2019
@sbrannen
Copy link
Member

sbrannen commented Sep 2, 2019

This sounds to me like a bug in the compiler that generated inappropriate byte code.

Upgrading your JDK is the correct solution.

I seem to recall that we used to recommend JDK 1.8.0 update 60 or higher, but I can't find any documentation spelling that out at the moment.

Our Upgrading to Version 5.0 wiki page simply states the following without mentioning a specific minimum update version.

Spring Framework 5.0 requires JDK 8 (Java SE 8) or above

The same is true for the reference manual:

As of Spring Framework 5.1, Spring requires JDK 8+ (Java SE 8+) and provides out-of-the-box support for JDK 11 LTS.

@sdeleuze pointed out that we have an outdated recommendation here:

React running on Nashorn. In that case, Java 8u60 or greater is required, due


Perhaps we should consider mentioning a recommended minimum update version for use with Spring.

@sbrannen sbrannen changed the title Exception when run maven test by maven-surefire-plugin Exception encountered with maven-surefire-plugin using JDK 1.8.0_45 Sep 2, 2019
@sbrannen sbrannen added for: team-attention type: documentation A documentation task and removed for: team-attention status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 2, 2019
@sbrannen sbrannen self-assigned this Sep 2, 2019
@sbrannen sbrannen modified the milestones: 5.2 RC2, 5.2 GA Sep 2, 2019
@sbrannen
Copy link
Member

sbrannen commented Sep 2, 2019

Team Decision: document that JDK 1.8 update 60 is suggested as the minimum patch release for Java 8 but mention that it is generally recommended to use a recent patch release.

@sbrannen
Copy link
Member

sbrannen commented Sep 5, 2019

Deliverables

Update the following documentation.

@sbrannen sbrannen changed the title Exception encountered with maven-surefire-plugin using JDK 1.8.0_45 Document minimum JDK 8 update version Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

3 participants