Guest User

Untitled

a guest
Dec 27th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. Description:
  2. Field userRepository in com.fitness.api.controller.UserController required a bean named 'entityManagerFactory' that could not be found.
  3.  
  4. Action:
  5. Consider defining a bean named 'entityManagerFactory' in your configuration.
  6.  
  7. @EnableJpaRepositories("com.test.api.repository")
  8. @SpringBootApplication
  9. public class ApiApplication {
  10.  
  11. public static void main(String[] args) {
  12. SpringApplication.run(ApiApplication.class, args);
  13. }
  14. }
  15.  
  16. spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
  17.  
  18. ## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
  19. # MySQL properties
  20. spring.datasource.url = jdbc:mysql://localhost:3306/test?useSSL=false
  21. spring.datasource.username = root
  22. spring.datasource.password = 1234
  23.  
  24. ## Hibernate Properties
  25. # The SQL dialect makes Hibernate generate better SQL for the chosen database
  26. spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
  27.  
  28. # Hibernate ddl auto (create, create-drop, validate, update)
  29. spring.jpa.hibernate.ddl-auto = update
  30.  
  31. buildscript {
  32. ext {
  33. springBootVersion = '2.1.0.RELEASE'
  34. }
  35. repositories {
  36. mavenCentral()
  37. }
  38. dependencies {
  39. classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  40. }
  41. }
  42.  
  43. @Entity
  44. @Table(name = "user")
  45. @EntityListeners(AuditingEntityListener.class)
  46. @JsonIgnoreProperties(value = {"createdAt", "updatedAt"},
  47. allowGetters = true)
  48. public class User implements Serializable {
  49. }
Add Comment
Please, Sign In to add comment