Home > database >  Spring boot startup: "Error creating bean with name 'entityManagerFactory', NoSuchFie
Spring boot startup: "Error creating bean with name 'entityManagerFactory', NoSuchFie

Time:02-25

Okay so I have this Spring Boot project that was working, but then I did.... something and now it won't work any more. When I try to start it up, I get the error: org.springframework.beans.factory.BeanCreationException: 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 java.lang.NoSuchFieldError: BEFORE_TRANSACTION_COMPLETION

By googling just "BEFORE_TRANSACTION_COMPLETION", I found JPA Buddy Popup

CodePudding user response:

when you run your application, please check this option is checked enter image description here

CodePudding user response:

Okay I figured it out. I can't believe I missed this.

My project required some dependencies that weren't available in central Maven repositories, so I copied the JAR files over from one of our other projects, into the LIB folder of my Scheduler project. My mistake was that I shotgunned it, and basically copied a whole bunch of JAR files I didn't need. Most of these, I think, just took up space and didn't cause any real harm. However, copying hibernate-core.jar DID cause this problem. I got rid of that JAR file and the scheduler started to work.

I'm pretty sure I have some more unnecessary JAR files in there too, so I'm going to continue the cleanup.

  • Related