Caused by: java.lang.ClassNotFoundException: javax.xml.bind.Validation

JAXB API是java EE 的API,因此在java SE 9.0 中不再包含这个 Jar 包。
java 9 中引入了模块的概念,默认情况下,Java SE中将不再包含java EE 的Jar包
而在 java 6/7 / 8 时关于这个API 都是捆绑在一起的

引入下面依赖即可

jaxb-api maven地址:http://mvnrepository.com/artifact/javax.xml.bind/jaxb-api

jaxb-impl maven地址:http://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl

jaxb-core maven地址:http://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-core

activation maven地址:http://mvnrepository.com/artifact/javax.activation/activation

<dependency>
     <groupId>javax.xml.bind</groupId>
     <artifactId>jaxb-api</artifactId>
     <version>2.3.0</version>
 </dependency>
 <dependency>
     <groupId>com.sun.xml.bind</groupId>
     <artifactId>jaxb-impl</artifactId>
     <version>2.3.0</version>
 </dependency>
 <dependency>
     <groupId>com.sun.xml.bind</groupId>
     <artifactId>jaxb-core</artifactId>
     <version>2.3.0</version>
 </dependency>
 <dependency>
     <groupId>javax.activation</groupId>
     <artifactId>activation</artifactId>
     <version>1.1.1</version>
 </dependency>


相关文章:

  • 2021-10-26
  • 2021-12-02
  • 2022-01-05
  • 2021-07-22
  • 2021-11-15
  • 2022-01-03
  • 2021-06-13
  • 2021-07-27
猜你喜欢
  • 2021-12-27
  • 2021-07-26
  • 2021-08-21
  • 2021-11-18
  • 2021-04-10
相关资源
相似解决方案