1

I have a Spring Boot 2.4 project that is using spring-boot-starter-data-solr. Unfortunately, spring-boot-starter-data-solr is not supported anymore (see https://spring.io/projects/spring-data-solr#overview) , so I can't easily upgrade Spring Boot as I usually do for other projects.

However, I thought I would still try to upgrade my project and keep using the latest spring-boot-starter-data-solr I could get : maybe it's not supported anymore, but I am not making an extensive use of it, so maybe I can take advantage of latest Spring Boot features for a some more time, before there's really a breaking change and I really can't use spring-boot-starter-data-solr

So, I upgraded my project to Spring Boot 2.6.4 letting Spring BOM pull all the latest versions of all dependencies managed. Of course, it failed on spring-boot-starter-data-solr, so I had to declare the version explicitly :

implementation 'org.springframework.boot:spring-boot-starter-data-solr:2.4.13'

I fixed few other things, and my project compiles. However, at startup (and in some integration tests), I have a problem :

    @Configuration
    public class PersistenceConfig {
    
        @Bean
        public TicketRepository ticketRepository(SolrTicketEntityRepository solrTicketEntityRepository) {
            return new TicketRepositoryImpl(solrTicketEntityRepository);
        }

    ... some other beans..

    }

with SolrTicketEntityRepository defined like below :

public interface SolrTicketEntityRepository extends SolrCrudRepository<TicketEntity, String> {

  @Query("?0")
  Page<TicketEntity> search(String searchText, Pageable pageable);

With Spring Boot 2.6, the SolrTicketEntityRepository doesn't get instanciated anymore, so I have a missing bean at startup. I've tried adding the @EnableSolrRepositories on PersistenceConfig, but it doesn't do anything.

is there a way to mimic Spring Boot magic, and trigger programmatically SolrTicketEntityRepository / SolrCrudRepository instanciation, to be able to start my application ?

or is it way too complicated, and as recommended here , should I implement the stuff myself with the core Solr libraries without Spring Boot's help (which would be the objective at some point anyway) ?

Vincent F
  • 6,523
  • 7
  • 37
  • 79

0 Answers0