zoukankan      html  css  js  c++  java
  • java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present错误

    今天在搭建spring cloud的时候,发现一直报“java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present”的错误

    后来发现,原来是因为用了jdk10的缘故。因为JAXB-API是java ee的一部分,在jdk10中没有在默认的类路径中。从jdk9开始java引入了模块的概念,可以使用模块命令--add-modles java.xml.bind引入jaxb-api;

    而我选择使用了另一种解决方法,在maven里面加入下面依赖,可以解决这个问题:

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

      

  • 相关阅读:
    Appium(一)安装
    Adb am/pm的使用
    RESTful API 设计指南
    选择物体生成Prefab
    C++网络开发Boost库
    Unity 猫眼效果
    React Native网络请求
    Unity高德LBS
    EasyTouch物体的旋转缩放
    Unity截屏分享朋友圈(微信)
  • 原文地址:https://www.cnblogs.com/xujanus/p/9024874.html
Copyright © 2011-2022 走看看