问题解决: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中删除。

 

<!--maven中引入-->
<dependency>
  <groupId>javax.xml.bind</groupId>
  <artifactId>jaxb-api</artifactId>
  <version>2.3.0</version>
</dependency>

 

[参考链接-StackOverFlow](地址)

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM