I was Having this issue also and your solution helped me, Thanks, And I add some other annotations to work
Fist make sure you put in SpringApplication Configuration
@SpringBootApplication
@EnableJpaAuditing
Second, make sure you use this annotation on your needed entities
@Entity
@Table
@EntityListeners(AuditingEntityListener.class)