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

Spring-boot 3.4.0 compatibility for JPA repositories #1958

Open
EugenMayer opened this issue Nov 21, 2024 · 6 comments
Open

Spring-boot 3.4.0 compatibility for JPA repositories #1958

EugenMayer opened this issue Nov 21, 2024 · 6 comments
Labels

Comments

@EugenMayer
Copy link
Contributor

Caused by: java.util.NoSuchElementException: No value present
	at java.base/java.util.Optional.get(Optional.java:143) ~[?:?]
	at com.blazebit.persistence.spring.data.impl.repository.BlazePersistenceRepositoryFactory.getQueryLookupStrategy(BlazePersistenceRepositoryFactory.java:264) ~[blaze-persistence-integration-spring-data-3.3-1.6.14.jar:1.6.14]
	at com.blazebit.persistence.spring.data.impl.repository.BlazePersistenceRepositoryFactory.getRepository(BlazePersistenceRepositoryFactory.java:438) ~[blaze-persistence-integration-spring-data-3.3-1.6.14.jar:1.6.14]
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$4(RepositoryFactoryBeanSupport.java:350) ~[spring-data-commons-3.4.0.jar:3.4.0]
	at org.springframework.data.util.Lazy.getNullable(Lazy.java:135) ~[spring-data-commons-3.4.0.jar:3.4.0]
	at org.springframework.data.util.Lazy.get(Lazy.java:113) ~[spring-data-commons-3.4.0.jar:3.4.0]
	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:356) ~[spring-data-commons-3.4.0.jar:3.4.0]
	at com.blazebit.persistence.spring.data.impl.repository.BlazePersistenceRepositoryFactoryBean.afterPropertiesSet(BlazePersistenceRepositoryFactoryBean.java:108) ~[blaze-persistence-integration-spring-data-3.3-1.6.14.jar:1.6.14]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1849) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1798) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.instantiateSingleton(DefaultListableBeanFactory.java:1116) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton(DefaultListableBeanFactory.java:1093) ~[spring-beans-6.2.0.jar:6.2.0]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1030) ~[spring-beans-6.2.0.jar:6.2.0]

Its one of our very few JPA repositories

@Repository
interface DwCacheApiRepository extends JpaRepository<DwCacheApiEntry, Long>
{}

Version: 1.6.14
JPA-Provider: Hibernate 6.6.3.Final
DBMS: MariaDB 11.5
Application Server:

@EugenMayer EugenMayer changed the title spring-boot 3.4.0 Spring-boot 3.4.0 compatibility Nov 21, 2024
@nexus061
Copy link

nexus061 commented Jan 7, 2025

The issue appears to be due to the deprecation of the method
getQueryLookupStrategy(@nullable Key key, QueryMethodEvaluationContextProvider evaluationContextProvider) replaced by the method getQueryLookupStrategy(@nullable Key key,ValueExpressionDelegate valueExpressionDelegate) in org.springframework.data.repository.core.support.RepositoryFactorySupport, the old overwritten method in JpaRepositoryFactory not exist and is called deprecated method from parent.

@EugenMayer EugenMayer changed the title Spring-boot 3.4.0 compatibility Spring-boot 3.4.0 compatibility for JPA repositories Jan 8, 2025
@dylfrancis
Copy link

Hi there, any update on this issue? EntityViewRepositories do not seem to work on version 3.4.1, so we have downgraded to 3.3.7, and it seems to working fine now. Thank you for all your hard work, it's really improved our team's experience working with JPA!

@beikov
Copy link
Member

beikov commented Jan 17, 2025

Not yet, no. Maybe @Mobe91 wants to look into this?

@EugenMayer
Copy link
Contributor Author

FYI, we are currently not interested in this support, since we removed all BP jpa repositories. IMHO using BP and then JPA repositories kind of seems defeating the purpose one has introduced BP for.

Replacing our JPA repositories ist pure BP implementations was not only very easy - it was better in the end.

Of course, that's a subjective take on it :) Just wanted to be transparent, that we are not looking into that (anylonger), someone else has to take over

@Mobe91
Copy link
Contributor

Mobe91 commented Jan 23, 2025

@EugenMayer Thanks for sharing.

If you don't mind I would still like to keep this issue open because we need to provide support for this for other users. Feel free to unsubscribe.

@Mobe91 Mobe91 reopened this Jan 23, 2025
@EugenMayer
Copy link
Contributor Author

Sorry for closing the issue, this was entirely by accident. Not sure how I managed to hit that button. I'am happy if you continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants