为什么是JDK11,由于jaxb是作为JDK8的一部分,在JDK11中已经被剥离出来需要单独引入。
com.sun.xml.bind jaxb-impl...jaxb-api:2.3.0" implementation "com.sun.xml.bind:jaxb-core:2.3.0" implementation "com.sun.xml.bind:jaxb-impl
artifactId>2.3.0com.sun.xml.bindjaxb-impl
artifactId> com.sun.xml.bind jaxb-impl
2.3.0 com.sun.xml.bind jaxb-impl
stackoverflow java.lang.NoSuchFieldError: REFLECTION 发现是com.sun.xml.bind:jaxb-core和com.sun.xml.bind:jaxb-impl...查看jar包依赖情况: 分别搜索jaxb-impl和jaxb-core,发现它们是jar包axis2-jaxws和cxf-rt-frontend-jaxws分别依赖的子包。...版本号分别是2.1.7和2.2.11,我这里是取消了axis2-jaxws对jaxb-impl的依赖,单独配置jaxb-impl的依赖,指定版本号和jaxb-core一致2.2.11。
dependency> javax.xml jaxb-impl
version>2.3.0 com.sun.xml.bind jaxb-impl
-- jaxb-impl --> com.sun.xml.bind jaxb-impl 2.3.0 <!
dependency> com.sun.xml.bind jaxb-impl
Spring Cloud体系,需要的所有依赖是: javax.xml.bind jaxb-api ${jaxb.version} com.sun.xml.bind jaxb-impl
dependency> com.sun.xml.bind jaxb-impl...2.3.0 com.sun.xml.bind jaxb-impl
jaxb-api com.sun.xml.bind jaxb-impl
配置文件使用 --> com.sun.xml.bind jaxb-impl...-- ehcache 读取 xml 配置文件使用 --> com.sun.xml.bind jaxb-impl
jaxb.version} com.sun.xml.bind jaxb-impl
>2.3.0 com.sun.xml.bind jaxb-impl
com.sun.xml.bind jaxb-impl
jaxb-core com.sun.xml.bind jaxb-impl
领取专属 10元无门槛券
手把手带您无忧上云