1. Error code
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.NoClassDefFoundError: javax/xml/bind/JAXBException
2. Cause resolution
JAXB API is considered as Java EE API, so it is no longer included in the default classpath of Java se 9. In Java, 11 they are completely removed from the JDK.
<!--maven import-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
Similar Posts:
- Hibernate Exception: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
- IDEA error: javax/xml/bind/DatatypeConverter [How to Solve]
- [Solved] Java.lang.ClassNotFoundException: javax.xml.bind.JAXBException (i)
- [Solved] Springboot Use Redis Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘redisTemplate’ defined in class path resource
- [Solved] No qualifying bean of type ‘org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder’ available:
- [How to Solve] RestController cannot be recognized in spring boot
- Springcloud: gateway module startup error
- Springboot always reports an error when importing JSP dependencies
- The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- Unregistering JMX-exposed beans on shutdown Solution