@CommanderBass it’s natural that this problem doesn’t manifest with Ehcache, since Ehcache does not have a Spring Data implementation.
The full error message referenced above contains more details on my suggestion:
RepositoryConfigurationExtensionSupport : Spring Data JPA - Could not safely identify store assignment
for repository candidate interface com.atlassian.connect.spring.AtlassianHostRepository;
If you want this repository to be a JPA repository,
consider annotating your entities with one of these annotations:
javax.persistence.Entity, javax.persistence.MappedSuperclass (preferred),
or consider extending one of the following types with your repository:
org.springframework.data.jpa.repository.JpaRepository
But looking further into that error message, I see this block in the same class (RepositoryConfigurationExtensionSupport
):
boolean qualifiedForImplementation = !strictMatchesOnly || configSource.usesExplicitFilters()
|| isStrictRepositoryCandidate(metadata);
Having multiple Spring Data implementations, e.g. JPA and Redis, on the class-path makes Spring Data enter strict mode, per an earlier log message from the same class:
Multiple Spring Data modules found, entering strict repository configuration mode
As the error message describes, AtlassianHostRepository
is not a strict repository candidate.
The remaining option of the three in the or condition is for the RepositoryConfigurationSource
to use explicit filters, which also seems to work (although it seems a bit hacky):
@EnableJpaRepositories(basePackageClasses = {AtlassianHostRepository.class}, excludeFilters = @ComponentScan.Filter)
I don’t see us solving this in atlassian-connect-spring-boot, since we don’t want to prescribe a specific Spring Data implementation. So when you use more than one, you need to somehow tell Spring Data in your app what implementation to use for AtlassianHostRepository
.