今天在搭建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>

  

java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present错误的更多相关文章

  1. SpringCloud启动Eureka server时报错 java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present

    SpringBoot打开Eureka server时出现以下错误: java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext ...

  2. java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present解决方案

    因为JAXB-API是java ee的一部分,在jdk9中没有在默认的类路径中: java ee api在jdk中还是存在的,默认没有加载而已,jdk9中引入了模块的概念,可以使用 模块命令--add ...

  3. 报错----运行springboot项目出现:Type javax.xml.bind.JAXBContext not present

    目的:运行springboot项目出现:Type javax.xml.bind.JAXBContext not present 环境: 问题:运行springboot项目出现:Type javax.x ...

  4. jdk10运行springboot项目出现:Type javax.xml.bind.JAXBContext not present

    项目由openjdk8.0迁移到jdk10导致的 原因:java9模块化的概念使得JAXB默认没有加载: jaxb-api是存在jdk中的,只是默认没有加载而已,手动引入即可. 推荐方式: <! ...

  5. java 9 Spring Cloud @EnableEurekaServer javax.xml.bind.JAXBContext not present

    java 9 Spring Cloud @EnableEurekaServer   javax.xml.bind.JAXBContext not present jdk 8下面还可以正常启动,jdk9 ...

  6. java连SQLServer失败 java.lang.ClassNotFoundException:以及 javax.xml.bind.JAXBException

    总结:jdk1.8及以下连sqlserver只需驱动,1.8以上除了驱动还需JAXB API. 1       java连SQLServer必须要先下驱动.否则出现: java.lang.ClassN ...

  7. Spring学习记录-Java 11运行eureka-server报javax.xml.bind.JAXBContext not present错

    在pom.xml加入依赖就行 <dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId&g ...

  8. MapReduce异常:java.lang.ClassCastException: interface javax.xml.soap.Text

    MapReduce异常:java.lang.ClassCastException: interface javax.xml.soap.Text java.lang.ClassCastException ...

  9. maven项目依赖jar包报 java.lang.classnotfoundexception:Type com.xx.xx.xxx not present 的解决

    今天在工作的时候遇到了这样一个奇葩的异常: java.lang.classnotfoundexception:Type com.ys.yahu.vo.file.MobileFileVo not pre ...

随机推荐

  1. [C#基础]说说lock到底锁谁?(补充与修改)

    摘要 今天在园子里面有园友反馈关于[C#基础]说说lock到底锁谁?文章中lock(this)的问题.后来针对文章中的例子,仔细想了一下,确实不准确,才有了这篇文章的补充,已经对文章中的demo进行修 ...

  2. python+selenium win32gui实现文件上传 enumerate()

    upload = dr.find_element_by_id('exampleInputFile0') upload.click() time.sleep(1) # win32gui dialog = ...

  3. Python+OpenCV图像处理(一)——读取显示一张图片

    先在此处先声明,后面学习python+opencv图像处理时均参考这位博主的博文https://blog.csdn.net/u011321546/article/category/7495016/2? ...

  4. ubuntu数据库安装配置

    感谢原作者 http://www.linuxidc.com/Linux/2016-12/138081.htm

  5. OpenCV入门笔记(七) 文字区域的提取

    https://blog.csdn.net/huobanjishijian/article/details/63685503 前面我们已经学了一些OpenCV中基本的图片处理的知识,可以拿来做一些小应 ...

  6. Vue小案例 之 商品管理------创建页面与部分数据

    logo的路径: 页面的初始布局: 初始的HTML: <div id="container"> <!--logo title--> <div clas ...

  7. BeanUtils工具的使用

    beanutils的下载地址:http://commons.apache.org/proper/commons-beanutils/download_beanutils.cgi 该压缩包有测试的代码: ...

  8. 复制MIFARE Classic卡

    Mifare Classic 1K智能卡介绍及nfc-tools的使用 [原创]RFID安全之——ACR122U菜鸟初体验-『智能设备』-看雪安全论坛 复制MIFARE Classic小区门禁卡记录 ...

  9. opencv学习之路(11)、图像几何变换

    一.图像缩放 #include<opencv2/opencv.hpp> using namespace cv; void main(){ Mat src=imread("E:// ...

  10. expr的字符串操作 表达式: length, index, match, substr等

    参考: http://www.linuxidc.com/Linux/2012-04/58095.htm expr的格式, 主要有两个, 一是 用expr option, 选项: 二是, expr的几个 ...