Issues upgrading to Spring Boot 3.1.2 ad Spring Data Solr 4.3.15

640 views Asked by At

I was using Spring Boot 2.x and with Spring Data SOLR 4.3.12 and Spring Data Commons 2.7.14, my app works normally connecting and querying SOLR.

I upgraded Spring Boot to 3.1.2 and spring Data SOLR 4.3.15 and Spring Data Commons 2.7.14, they are no longer compatible, as I see the below compilation error it is not available in my classpath.

java: cannot access org.springframework.data.repository.ListCrudRepository class file for org.springframework.data.repository.ListCrudRepository not found

If I upgrade Spring Data Commons 3.1.2, my build is successful. But starting the app throws the below error.

Caused by: java.lang.NoClassDefFoundError: org/springframework/data/convert/EntityInstantiators at org.springframework.data.solr.core.convert.MappingSolrConverter.(MappingSolrConverter.java:128) at org.springframework.data.solr.core.SolrTemplate.getDefaultSolrConverter(SolrTemplate.java:669) at org.springframework.data.solr.core.SolrTemplate.afterPropertiesSet(SolrTemplate.java:726) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1817) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ... 15 common frames omitted

Can someone help how I can resolve this? If Spring Data Commons is not upgraded to be compatible with Spring Boot 3.1.2, Is there a way I can still use the old version (2.7.14) of Spring Data Commons for Spring Data SOLR (4.3.15) in Maven and my other dependencies that rely on Spring Data Commons (3.1.2) can continue to use the latest version excluding the old version.

1

There are 1 answers

0
ydrozhdzhal On

Not sure, but today I found this library: https://github.com/NET-A-PORTER/spring-data-solr

Looks like it is port of spring-data-solar to Spring Data 3.1.0 Want to try it on my local project after update to Spring Boot 3.x. Also it is available on Maven Central repository, so you can try it to and provide your feedback.