是因为id注解引错的包 错误的包路径: import org.springframework.data.annotation.Id; 正确的包路径: import javax.persistence.Id;