Java--Eureka報錯java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
今天在執行程式的時候,一直報“java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present”的錯誤, 程式碼之前一直沒有動過,唯一的改變的就是之前用的是jdk8,昨天解除安裝了jdk8,重灌了jdk12。
百度原因,發現是因為用了jdk12的緣故。因為JAXB-API是java ee的一部分,在jdk12中沒有在預設的類路徑中。從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>
相關文章
- JAXBContext版本衝突java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present atContextJavaExceptionXML
- JDK11執行springboot專案出現:Type javax.xml.bind.JAXBContext not presentJDKSpring BootJavaXMLContext
- querydsl報錯: Attempt to recreate a file for type
- React報錯之Element type is invalidReact
- Vuex中使用報錯unknown mutation typeVue
- Qt 報錯 “類名”does not name a typeQT
- springboot開發介面報錯Optional int parameter 'userId' is present but cannot be translated into a null v......Spring BootNull
- `jsonb` 報錯 `invalid input syntax for type timestamp with time zone ““JSON
- golang使用sqlx報錯:unsupported type []interface {}, a slice of interfaceGolangSQL
- oracle匯入TYPE物件報錯ORA-02304Oracle物件
- npm報錯 TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.Received undefineNPMError
- eclipse :報錯 ‘XXXX‘ does not name a type的解決辦法Eclipse
- SAP為Storage Type 004啟用SUM報錯 - Storage types without pick-point stor.type
- Rasa init報錯:AttributeError: type object 'Callable' has no attribute '_abc_registry'ErrorObject
- SAP對物料做上架報錯 :Definition of totals level is missing for storage type
- std::unique_ptr使用incomplete type的報錯分析和解決
- JDK安全證書一個錯誤訊息 No subject alternative names presentJDK
- Pycharm:設定完Anaconda後報錯TypeError: an integer is required (got type bytes)PyCharmErrorUIGo
- python用pyinstaller生成exe時報錯 TypeError: an integer is required (got type bytes)PythonErrorUIGo
- QTCreator 除錯:unknown debugger type “No engine“QT除錯
- springboot使用jpa啟動報錯consider defining a bean of type '*.*.**Repository' in your configuration....Spring BootIDEBean
- R語言ggsurvplot繪製生存曲線報錯 : object of type ‘symbol‘ is not subsettableR語言ObjectSymbol
- SAP MM 維護公司間STO報錯-No delivery type defined for supplying plant-
- SpringBoot升級到3.2.0報錯Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.StringSpring BootBeanObjectJava
- PostgreSQL cache lookup failed for type XXXX 錯誤SQLAI
- SSL - SSLHandshakeException: No subject alternative names presentException
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- 【C#】Newtonsoft.Json 中 JArray 新增陣列報錯:Could not determine JSON object type for typC#JSONJAR陣列Object
- webstorm vue3+ts報錯:Cannot find module ‘@/views/xxx.vue‘ or its corresponding type declarationsWebORMVueView
- 【盜墓筆記】Android開發中匯入第三方庫所遇問題記錄——Program type already present筆記Android
- QT中error: xxx does not name a type xxx錯誤QTError
- 如何處理ABAP DDIC_TYPE_INCONSISTENCY錯誤
- xcode6編譯錯誤,提示Expected a typeXCode編譯
- MYSQL中 TYPE=MyISAM 錯誤的解決方法MySql
- 通俗易懂解釋一類和二類錯誤(Type I Error Type II Error)Error
- SAP對PO收貨後LT06報錯-Allowed storage unit types not defined for storage type Z
- eclipse中:The type java.lang.object cannot be resolved錯誤(jdk配置錯誤)EclipseJavaObjectJDK
- SAP 對STO的交貨單執行PGI,報錯 -Fld selectn for mvmt type 643 acct 400020 diff