问题解决:Java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

1.错误代码

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.原因解决

翻译一段:JAXB api被认为是Java EE api,因此不再包含在Java SE 9默认的类路径。在Java中11他们完全从JDK中删除。


<dependency>
    <groupId>javax.xml.bindgroupId>
    <artifactId>jaxb-apiartifactId>
    <version>2.3.0version>
dependency>

参考链接-StackOverFlow

你可能感兴趣的:(问题解决)