In my jmix gradle project i have added my another library project as dependency. That added project is spring boot project that uses spring-data-jpa.
in my jmix application i changed the main like
@SpringBootApplication(scanBasePackages = {“com.batchpackage.batchproj”})
public class JmixApp extends SpringBootServletInitializer {
com.batchpackage.batchproj is the library project.
And i have some repository classes like
public interface BatchConfigRepository extends CrudRepository<BatchConfig, Integer> {} , public interface BatchStatusRepository extends CrudRepository<BatchStatus, Integer> {}.
When i try to run jmix application it shows error as The bean 'batchConfigRepository ', defined in com.batchpackage.batchproj.repository.BatchConfigRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration, could not be registered. A bean with that name has already been defined in com.batchpackage.batchproj.repository.BatchConfigRepository defined in @EnableJmixDataRepositories declared on BootJmixRepositoriesRegistrar.EnableJmixDataRepositoriesConfiguration and overriding is disabled.
My conclusion is both jmix and spring-data jpa is trying to create bean for same repository. Is there any solution for this. More specific can i say i dont want jmix data to scan the given package like jmix please exclude com.batchpackage.batchproj from scanning