Blazebit / blaze-persistence

Rich Criteria API for JPA providers
https://persistence.blazebit.com
Apache License 2.0
705 stars 83 forks source link

Startup error with Spring Boot 3.3.0 and Blaze Persistence Repositories #1906

Open pvncoder opened 1 month ago

pvncoder commented 1 month ago

Description

After updating my project to the new Spring Boot 3.3.0, I encountered errors during the application startup in EntityView repositories (those extending EntityViewRepository) from Blaze Persistence:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.blazebit.persistence.spring.data.base.query.JpaParameters.<init>(JpaParameters.java:58)

The following method did not exist:

    'void org.springframework.data.repository.query.Parameters.<init>(java.lang.reflect.Method)'

The calling method's class, com.blazebit.persistence.spring.data.base.query.JpaParameters, was loaded from the following location:

    jar:file:{m2-path}/.m2/repository/com/blazebit/blaze-persistence-integration-spring-data-base-3.1/1.6.11/blaze-persistence-integration-spring-data-base-3.1-1.6.11.jar!/com/blazebit/persistence/spring/data/base/query/JpaParameters.class

The called method's class, org.springframework.data.repository.query.Parameters, is available from the following locations:

    jar:file:{m2-path}/.m2/repository/org/springframework/data/spring-data-commons/3.3.0/spring-data-commons-3.3.0.jar!/org/springframework/data/repository/query/Parameters.class

The called method's class hierarchy was loaded from the following locations:

    org.springframework.data.repository.query.Parameters: file:{m2-path}/.m2/repository/org/springframework/data/spring-data-commons/3.3.0/spring-data-commons-3.3.0.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes com.blazebit.persistence.spring.data.base.query.JpaParameters and org.springframework.data.repository.query.Parameters

The issue seems to be in the JpaParameters class of BP, which is trying to call a non-existent method in the superclass Parameters from Spring Data Commons. Additionally, this class from BP is also trying to override a method that no longer exists. image image

Expected behavior

I expected the EntityView repositories to initialize and work correctly after updating to Spring Boot 3.3.0. This update is particularly important because Spring Boot 3.3.0 includes an upgrade to Hibernate 6.5.x. The new Hibernate version brings significant improvements, including the ability to pre-generate IDs for entities that are yet to be persisted. Consider a scenario where UUIDs (PKs) are generated within a mobile application. With the new Hibernate version, you can seamlessly handle these pre-generated UUIDs during the persistence process.

Actual behavior

The application fails to start, specifically in repositories that extend EntityViewRepository, due to missing methods in the Parameters class from Spring Data Commons.

Steps to reproduce

Environment

shopera007 commented 1 month ago

This is why it's important to use a library that has strong community support.

EugenMayer commented 1 month ago

On holidays this week, could try to take care of sb 3.0 support after that

shopera007 commented 1 month ago

@EugenMayer Why did you find my words so offensive? It's a truism: the library is great but needs a large community. Good luck keeping up with new Spring Boot versions.

beikov commented 1 month ago

We managed to keep up with the Spring boot versions so far and will do so in the future as well, but someone from the community needs to step up and help with that. So far, @EugenMayer worked on this, so he will surely look into this when he has time. If you can't await that, please provide a PR with a fix.

EugenMayer commented 4 weeks ago

Started with the integration in #1912 - might take a bit since we have to create new integration libraries