zoukankan      html  css  js  c++  java
  • 真正解决方案:java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

    今天在使用JDK 12.0 环境下使用Hibernate 时候出现了这个错误,错误日志如下:

    故障原因:

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

    解决方案一:

    降低JDK 版本到 JDK 8

    解决方案二:(亲测可行)

    手动加入这些依赖Jar包

    <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>
    
    
  • 相关阅读:
    数据库操作
    jquery 第一章
    算法很美 第一章
    python 学习第四天
    python学习第三天
    python学习第二天
    学习python的第一天
    C#-线程
    C#-流、存储
    C#-集合
  • 原文地址:https://www.cnblogs.com/smfx1314/p/11071718.html
Copyright © 2011-2022 走看看