I face a strange issue after upgrading my existing code from spring boot 2.2.0 to 2.2.1.
It seems that my spring data jdbc repositories are not getting scanned anymore somehow:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'de.thd.dmpk.establishmentmanagement.IEstablishmentRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Furthermore this informational debug line is there as well with boot 2.2.1:
Spring Data JDBC - Could not safely identify store assignment for repository candidate interface de.thd.dmpk.establishmentmanagement.IEstablishmentRepository. If you want this repository to be a JDBC repository, consider annotating your entities with one of these annotations: org.springframework.data.relational.core.mapping.Table.
When i switch everything back to boot 2.2.0 the info message as well as the exceptions above are disappearing.
Any hints?
EDIT
Entity
@Getter
@RequiredArgsConstructor(staticName = "of", access = AccessLevel.PUBLIC, onConstructor = @__({@PersistenceConstructor}))
@EqualsAndHashCode
public final class Establishment {
private final @Id
@With
long establishmentId;
@NotNull
@NotEmpty
@Size(max = 255)
private final
String establishmentName;
}
Repository
interface IEstablishmentRepository extends CrudRepository<Establishment, Long>
Up to now a @Table
Annotation was not necessary if you don´t want to change the table name on the db. Furthermore @EnableJdbcRepositories
scans per documentation that way:
If no base package is configured, it uses the package in which the configuration class resides. https://docs.spring.io/spring-data/jdbc/docs/current/reference/html/#jdbc.java-config
Strange things going on there :)