You might need to use Spring Boot's @EntityScan
annotation if your JPA entities are not in a sub-package of com.example.configuration
. I would also recommend that you move your @Configuration
off the SpringBootServletInitializer
and into its own class.
If you can move your configuration class up a level you can drop the @ComponentScan
, @EnableJpaRepositories
and @EntityScan
annotations all together (see http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-locating-the-main-class)
If @EntityScan
doesn't fix things perhaps you could provide an example project that we can look at?