Skip to content

Test against Java 20 in CI. #2701

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

Closed
gregturn opened this issue Mar 28, 2023 · 6 comments
Closed

Test against Java 20 in CI. #2701

gregturn opened this issue Mar 28, 2023 · 6 comments
Labels
type: task A general task

Comments

@gregturn
Copy link
Contributor

No description provided.

@michael-simons
Copy link
Collaborator

Do you need input from us on that one @gregturn ?

@gregturn
Copy link
Contributor Author

I'll let you know if I run into anything.

gregturn added a commit that referenced this issue Mar 30, 2023
@gregturn
Copy link
Contributor Author

I took at shot at pushing a Jenkins update that would run on Java 20, but it failed twice. You can see the latest one at https://jenkins.spring.io/blue/organizations/jenkins/spring-data-neo4j/detail/main/1245/pipeline/ (let me know if you can't).

The details are in the latest commit on https://github.com/spring-projects/spring-data-neo4j/tree/issue/java20. (I had to test it on the main branch, but pulled back from that and moved the work to this side branch).

I'm frankly not certain WHAT is causing the grief.

FYI: I have been using this version of Java 20 locally for test purposes.

Temurin       | >>> | 20           | tem     | installed  | 20-tem            

If you wish to run the test suite locally against Temurin 20-tem, perhaps there would be clearer insight into what's actually broken.

@michael-simons
Copy link
Collaborator

michael-simons commented Mar 31, 2023

My analysis of this: In ReactiveImmutableAssignedIdsIT we do have the following entity callback defined:

@Bean
ReactiveBeforeBindCallback<ImmutablePersonWithAssignedId> valueChange() {
	return entity -> {
		entity.someValue = SOME_VALUE_VALUE;
		return Mono.just(entity);
	};
}

matching ImmutablePersonWithAssignedId.

The failure occurs when persisting a ImmutableSecondPersonWithAssignedId.

org.springframework.data.mapping.callback.DefaultReactiveEntityCallbacks.DefaultReactiveEntityCallbackInvoker has a method invokeCallback that catches a ClassCastException when org.springframework.data.mapping.callback.EntityCallbackDiscoverer#computeCallbackInvokerFunction discovered a callback that does not match the actual entity type.

Sorry for the screenshots, but that's easier to reformat the reactive stack traces here. This is the stack for JDK 17 when ending up in this case:

image

JDK 20 acts totally different

image

I am unsure if Spring Data Commons must fix this in org.springframework.util.ReflectionUtils#invokeMethod(java.lang.reflect.Method, java.lang.Object, java.lang.Object...) or in org.springframework.data.mapping.callback.DefaultReactiveEntityCallbacks but I am sure that this is not a SDN but an Spring Data Commons issue.

Update: This is the simplest test to reproduce it with any JDK 20 (I used Azul) org.springframework.data.neo4j.integration.reactive.ReactiveImmutableAssignedIdsIT#saveRelationshipWithAssignedIdsContainsObjectWithIdSetForMapCollection

cc @mp911de

@michael-simons
Copy link
Collaborator

@gregturn I don't think its Project reactor. It's the DefaultReactiveEntityCallbackInvoker. It catches only ClassCastException commented whereas SimpleEntityCallbackInvoker catches IllegalArgumentException | ClassCastException ex, see linked ticket.

gregturn added a commit that referenced this issue Apr 4, 2023
gregturn added a commit that referenced this issue Apr 4, 2023
@gregturn
Copy link
Contributor Author

gregturn commented Apr 4, 2023

Thanks @michael-simons. We've since solved this, and I've verified building Spring Data Neo4j against Java 20.

@gregturn gregturn closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants