JAXBContext版本衝突java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present at
- 在建立springcloud專案時,建立eureka服務註冊時報錯java.lang.TypeNotPresentException,JAXBContext版本錯誤
- 在檢查jdk版本沒有錯亂、以及pom檔案中根本沒有相關依賴,意識到應該是版本衝突的鍋導致的,經百度查詢果然是版本衝突,然後按照下面這個連線進行依賴匯入,成功解決
- 我jdk版本是11,用1.8就不會產生這個問題了
https://blog.csdn.net/weixin_45012575/article/details/100548253
java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperInterfaces(ClassRepository.java:117) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:95) ~[na:na]
at java.base/java.lang.Class.getGenericInterfaces(Class.java:1112) ~[na:na]
at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:629) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.reflection.ReflectionHelper.getClass(ReflectionHelper.java:625) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.spi.factory.ContextResolverFactory.getParameterizedType(ContextResolverFactory.java:202) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.core.spi.factory.ContextResolverFactory.init(ContextResolverFactory.java:89) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1332) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) ~[jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394) ~[jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:744) ~[jersey-servlet-1.19.1.jar:1.19.1]
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:112) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4591) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5233) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.23.jar:8.5.23]
這是匯入的依賴
<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--Eureka報錯java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not presentJavaExceptionXMLContext
- JDK11執行springboot專案出現:Type javax.xml.bind.JAXBContext not presentJDKSpring BootJavaXMLContext
- Java依賴版本衝突Java
- git 解決版本衝突問題Git
- Git 解決本地遠端版本衝突Git
- GO 問題之多版本衝突解決Go
- Servlet版本衝突導致頁面404Servlet
- Flutter | 如何優雅的解決依賴版本衝突Flutter
- 使用 etcd 和 grpc 遇到的版本衝突的那些事兒RPC
- 解決專案版本衝突——maven-shade外掛使用Maven
- Ubuntu pecl 多版本 PHP 安裝擴充套件,避免衝突UbuntuPHP套件
- 雜湊衝突
- 版本不相容Jar包衝突該如何是好?JAR
- lvm 名稱衝突LVM
- git 解決衝突Git
- Git 解決衝突Git
- GitHub Desktop釋出1.5版本,簡化合並衝突解決Github
- InnoDB鎖衝突案例演示
- Manjaro更新出現衝突JAR
- 處理併發衝突
- [20200801]sql hint衝突.txtSQL
- 雜湊衝突詳解
- 程式衝突及其解決
- git pull 衝突解決Git
- Activemq和Rabbitmq埠衝突MQ
- hash衝突解決方法
- Git衝突解決技巧Git
- 解衝突用到的命令
- 用層級理解衝突
- Git 衝突了怎麼辦,如何高效快速的解決程式碼衝突?Git
- js檔案命名衝突理解JS
- SVN解決衝突 記錄
- css命名衝突解決方法CSS
- RecyclerView 、ViewPager 左右滑動衝突Viewpager
- Maven依賴衝突處理Maven
- 埠衝突,可愛的8080
- javamelody與swagger註解衝突JavaSwagger
- 科研和工作並不衝突