Spring boot项目启动Eureka出现Type javax.xml.bind.JAXBContext not present

时间:2020-09-10 22:34:19   收藏:0   阅读:72

环境说明:
win10 + java11 + springboot 2.0.6 + spring cloud Finchley.SR2

问题原因:Java9+版本以后,JAXB默认没有加载

解决办法:手动添加jaxb模块

<dependency>
   <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
</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>

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!