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:
- Error resolution: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/Datatype
- org.thymeleaf.exceptions.TemplateInputException: Error resolving template [hello scope], template mi
- Jjwt error: ERROR 9856 — [nio-8083-exec-2] o.a.c.c. [. [. [. [/]. [dispatch server]
- [Solved] org.thymeleaf.exceptions.TemplateInputException: Error resolving template
- Tomcat cross server upload error 403forbidden [How to Solve]
- [Solved] MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.Runtime
- [Solved] Error updating database. Cause: java.sql.SQLException: Incorrect integer value: ‘**‘ for column
- [Solved] SpringBoot Create Project and Failed to Access localhost:8080 Error
- [Solved] JSONUtil.toJsonStr() Error: org.springframework.web.util.NestedServletException: Handler dispatch failed…
- [Solved] Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘:
- [Solved] org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot
- [Solved] java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
- Caused by: java.lang.IllegalStateException (How to Fix)
- spring cloud 2020 gateway Error 503 [How to Solve]
- [Solved] Spring cloud zuul Error: com.netflix.zuul.exception.ZuulException
- [Solved] Spring Cloud Use Ribbon Error: No instances available for XXX
- [Solved] fastjson Error: write javaBean error, fastjson version 1.2.76, class io.undertow.servlet.xx
- Microservice call exceptions: error feign.RetryableException: Read timed out executing POST http://xxx…….
- [Solved] org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception
- Error resolving template [index], template might not exist