• NoClassDefFoundError: javax/xml/bind/DatatypeConverter错误原因以及解决办法


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

    报错界面:

    报错原因:

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

    解决办法:

    方案一:

    降低JDK版本至 JDK 8

    方案二:

    在pom.xml文件的dependencies中引入以下部件:

    <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>
    
    
  • 相关阅读:
    ISpout源码解析
    storm完全分布式部署
    sqoop工具
    sqoop安装步骤
    HBASE常用配置
    linux命令无法使用:命令行输入:set>lll cat lll echo $PATH
    BubbleSort
    QuickSortWithRec
    面试题
    Nginx配置安装
  • 原文地址:https://www.cnblogs.com/Courage129/p/14045183.html
Copyright © 2020-2023  润新知