Failed to initialize JPA EntityManagerFactory: No identifier specified for entity 에러 해결법

728x90

Failed to initialize JPA EntityManagerFactory: No identifier specified for entity 에러 해결법


Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity

위와 같은 오류가 발생했을 경우, 엔티티의 @Id 어노테이션 항목의 import 경로를 javax.persistence.id로 수정한다.

728x90