79494873

Date: 2025-03-08 19:01:44
Score: 2
Natty:
Report link

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)
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): get the same error
  • Low reputation (0.5):
Posted by: Rujal Manandhar