try { this.invokeInitMethods(beanName, wrappedBean, mbd); } catch (Throwable ex

When does this exception occurs in the application ? Also When does this exception occurs ? try { this.populateBean(beanName, mbd, instanceWrapper); exposedObject = this.initializeBean(beanName, exposedObject, mbd); } catch (Throwable var18) { if (var18 instanceof BeanCreationException bce) { if (beanName.equals(bce.getBeanName())) { throw bce; } } Also when does this exception comes org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: jakarta/persistence/PersistenceUnitTransactionType Also when does this exception occurs ? if (mbd.isSingleton()) { sharedInstance = this.getSingleton(beanName, () -> { try { return this.createBean(beanName, mbd, args); } catch (BeansException ex) { this.destroySingleton(beanName); throw ex; } }); beanName: entityManagerFactory Exception : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: jakarta/persistence/PersistenceUnitTransactionType I m getting this error currently when starting the application
17 Replies
JavaBot
JavaBot•6mo ago
⌛ This post has been reserved for your question.
Hey @DevAakash! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot•6mo ago
Please format your code to make it more readable. For java, it should look like this:
​`​`​`​java
public void foo() {

}
​`​`​`​
​`​`​`​java
public void foo() {

}
​`​`​`​
DevAakash
DevAakashOP•6mo ago
what is the
DevAakash
DevAakashOP•6mo ago
Can anyone help me with this one ? #help-notifications Can anyone help?
ayylmao123xdd
ayylmao123xdd•6mo ago
show the stack trace for that error you are getting im on mobile so cant view the files show where it says causedby
DevAakash
DevAakashOP•6mo ago
where I can find it ?
ayylmao123xdd
ayylmao123xdd•6mo ago
when you get the error its gonna say
DevAakash
DevAakashOP•6mo ago
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: jakarta/persistence/PersistenceUnitTransactionType at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1826) ~[spring-beans-6.2.8.jar:6.2.8]
ayylmao123xdd
ayylmao123xdd•6mo ago
but the caused by message lower in the exception its gonna say caused by
DevAakash
DevAakashOP•6mo ago
Caused by: java.lang.ClassNotFoundException: jakarta.persistence.PersistenceUnitTransactionType at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na] ... 34 common frames omitted @ayylmao123xdd is this something you're looking for ?
ayylmao123xdd
ayylmao123xdd•6mo ago
yes it says it cant find persistence unit transaction type see if you imported it ill look into it tomorrow cuz i gtg
DevAakash
DevAakashOP•6mo ago
I have used the normal imports in the project import jakarta.persistence.*;
Karlas2
Karlas2•6mo ago
You're getting this: vbnet Copy Edit BeanCreationException: Error creating bean with name 'entityManagerFactory' Caused by: ClassNotFoundException: jakarta.persistence.PersistenceUnitTransactionType 🎯 Cause You're missing the Jakarta Persistence API dependency. Hibernate 6+ and Spring Boot 3+ require it. ✅ Fix If using Maven: xml Copy Edit <dependency> <groupId>jakarta.persistence</groupId> <artifactId>jakarta.persistence-api</artifactId> <version>3.1.0</version> </dependency> If using Gradle: groovy Copy Edit implementation 'jakarta.persistence:jakarta.persistence-api:3.1.0' Add it to your build, then clean and restart the app.
JavaBot
JavaBot•6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
DevAakash
DevAakashOP•6mo ago
I already have this dependency in my project but its still giving the error
ayylmao123xdd
ayylmao123xdd•6mo ago
can you run mvn clean compile if you se maven if gradle use ./gradlew clean build also copy and paste from ai isnt the best idea to help (if u used it)
JavaBot
JavaBot•6mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?