错误详情:
16:58:52.816 [http-nio-8080-exec-7] ERROR c.r.f.w.e.GlobalExceptionHandler - [handleException,83] - Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1053)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
原因:
是由于缺少jaxb-api包导致的。在Java 8以及以前的版本,是默认包含jaxb这个jar包的;但是在java SE 9.0就不再包含着个包了,如果使用则需要手动引进。
JAXB API是java EE 的API,因此在java SE 9.0 中不再包含这个 Jar 包。 java 9
中引入了模块的概念,默认情况下,Java SE中将不再包含java EE 的Jar包 而在 java 6/7/8 时关于这个API
都是捆绑在一起的
解决:
降低JDK版本到1.8
手动导入以下包:
<dependency>
<groupId>javax.xml.bindgroupId>
<artifactId>jaxb-apiartifactId>
<version>2.3.0version>
dependency>
<dependency>
<groupId>com.sun.xml.bindgroupId>
<artifactId>jaxb-implartifactId>
<version>2.3.0version>
dependency>
<dependency>
<groupId>com.sun.xml.bindgroupId>
<artifactId>jaxb-coreartifactId>
<version>2.3.0version>
dependency>
<dependency>
<groupId>javax.activationgroupId>
<artifactId>activationartifactId>
<version>1.1.1version>
dependency>
————————————————
原文链接:https://blog.csdn.net/qq_44895397/article/details/108626052
0条评论