zoukankan      html  css  js  c++  java
  • java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present解决方案

     因为JAXB-API是java ee的一部分,在jdk9中没有在默认的类路径中;

    java ee api在jdk中还是存在的,默认没有加载而已,jdk9中引入了模块的概念,可以使用

    模块命令--add-modles java.xml.bind引入jaxb-api;

    这些模块默认没有加入:

    java.activation
    java.corba
    java.transaction
    java.xml.bind  << This one contains the JAXB APIs
    java.xml.ws
    java.xml.ws.annotation

    解决方案:在pom.xml文件引入以下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>org.glassfish.jaxb</groupId>
                <artifactId>jaxb-runtime</artifactId>
                <version>2.3.0</version>
            </dependency>
            <dependency>
                <groupId>javax.activation</groupId>
                <artifactId>activation</artifactId>
                <version>1.1.1</version>
            </dependency>
    复制代码
    本文引自:https://www.cnblogs.com/stono/p/8445312.html
  • 相关阅读:
    PAT 1032 (未完成)
    PAT 1031
    PAT 1030
    将爬取到的数据存入数据框并导出
    XPath常见用法
    python 图表
    Protobuf在Unity中的通讯使用
    ProtoBuf在Unity中的使用
    Unity更新资源代码
    匿名函数
  • 原文地址:https://www.cnblogs.com/zlsxddgj/p/9305600.html
Copyright © 2011-2022 走看看