Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Description:
- Field userRepository in com.fitness.api.controller.UserController required a bean named 'entityManagerFactory' that could not be found.
- Action:
- Consider defining a bean named 'entityManagerFactory' in your configuration.
- @EnableJpaRepositories("com.test.api.repository")
- @SpringBootApplication
- public class ApiApplication {
- public static void main(String[] args) {
- SpringApplication.run(ApiApplication.class, args);
- }
- }
- spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
- # MySQL properties
- spring.datasource.url = jdbc:mysql://localhost:3306/test?useSSL=false
- spring.datasource.username = root
- spring.datasource.password = 1234
- ## Hibernate Properties
- # The SQL dialect makes Hibernate generate better SQL for the chosen database
- spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
- # Hibernate ddl auto (create, create-drop, validate, update)
- spring.jpa.hibernate.ddl-auto = update
- buildscript {
- ext {
- springBootVersion = '2.1.0.RELEASE'
- }
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
- }
- }
- @Entity
- @Table(name = "user")
- @EntityListeners(AuditingEntityListener.class)
- @JsonIgnoreProperties(value = {"createdAt", "updatedAt"},
- allowGetters = true)
- public class User implements Serializable {
- }
Add Comment
Please, Sign In to add comment