[Solved] nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

Error: javax/xml/bind/DatatypeConverter

Error content

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:1055)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
  at

Error reporting reason:

JAXB API is an API for java EE and this Jar package is no longer included in java SE 9.0.
By default, the Jar package for java EE will no longer be included in Java SE
In JDK 6/7/8 about this API are bundled together.

Solutioin:

Method I:

Downgrade the version of JDK to JDK 8

Method II:

The following parts are introduced into the dependencies of the pom.xml file:

<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>

Read More: