上面是代码:
下面是错误:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController’: Unsatisfied dependency expressed through field ‘userRepository’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userDao’: Cannot create inner bean ‘(inner bean)#4f66ffc8’ 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)#4f66ffc8’: Cannot resolve reference to bean ‘entityManagerFactory’ while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘entityManagerFactory’ available
数据库:本地, 名称 weifuwu, 没有创建表。 因为文档说 可以自动创建表