This is regarding disabling the db connection at the startup. we do not want to connect to the db during the starting of the application.
I googled around and checked the previous questions in Stack overflow and checked the spring documentation to disabling the database connection at the startup. configuration suggested is exclude= [DataSourceAutoConfiguration]. below are the annotation on the SpringApplication class but the application fails and does not start.
@EnableAsync
@EnableMBeanExport
@EnableJpaRepositories('org.*.*')
@EntityScan('org.*.*.domain.jpa')
@SpringBootApplication(exclude= [DataSourceAutoConfiguration])
getting following exception during the startup , AM I missing any configuration, Thanks for your help in advance.
Error creating bean with name ‘annotationRepository’ defined in org...*.jpa.AnnotationRepository defined in @EnableJpaRepositories declared on Application: Cannot create inner bean ‘(inner bean)#e30573c’ of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property ‘entityManager’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘(inner bean)#e30573c’: Cannot resolve reference to bean ‘entityManagerFactory’ while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘entityManagerFactory’ available