I know this is an old question. But to anybody who's facing it, this might help you
You only saw the first part of the log; if you scroll down to almost the end of the log file, you'll see a more specific log pointing you toward the answer.
For example, if you use @Column
instead of @JoinColumn
in your @ManyToOne
relationship, you get the same error. But if you look at the complete log, you'll see why it happened.
Error creating bean with name 'userRepository' defined in com.so.repository.UserRepository defined in @EnableJpaRepositories declared on Application: Cannot resolve reference to bean 'jpaSharedEM_entityManagerFactory' while setting bean property 'entityManager'
.
.
.
Caused by: org.hibernate.AnnotationException: Property 'com.so.domain.UserComment.user' is a '@ManyToOne' association and may not use '@Column' to specify column mappings (use '@JoinColumn' instead)