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
- Qt 報錯 “類名”does not name a typeQT
- React報錯之Element type is invalidReact
- Vuex中使用報錯unknown mutation typeVue
- Linux 報錯"mount: unknown filesystem typeLinux
- golang使用sqlx報錯:unsupported type []interface {}, a slice of interfaceGolangSQL
- springboot開發介面報錯Optional int parameter 'userId' is present but cannot be translated into a null v......Spring BootNull
- SAP為Storage Type 004啟用SUM報錯 - Storage types without pick-point stor.type
- npm報錯 TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string.Received undefineNPMError
- oracle匯入TYPE物件報錯ORA-02304Oracle物件
- Qt 標頭檔案互相包含會報錯'' does not name a typeQT
- `jsonb` 報錯 `invalid input syntax for type timestamp with time zone ““JSON
- std::unique_ptr使用incomplete type的報錯分析和解決
- SAP對物料做上架報錯 :Definition of totals level is missing for storage type
- Qt5.7中報錯“xxx dose not name a type”的原因;QT
- 報錯:Missing type map configuration or unsupported mappingAPP
- IMP同庫Type物件匯入報錯ORA-02304物件
- R語言ggsurvplot繪製生存曲線報錯 : object of type ‘symbol‘ is not subsettableR語言ObjectSymbol
- Rasa init報錯:AttributeError: type object 'Callable' has no attribute '_abc_registry'ErrorObject
- Pycharm:設定完Anaconda後報錯TypeError: an integer is required (got type bytes)PyCharmErrorUIGo
- IMP同庫Type物件匯入報錯ORA-02304(續)物件
- JDK安全證書一個錯誤訊息 No subject alternative names presentJDK
- 編譯錯誤 --- does not name a type和field `XX' has incomplete type編譯
- SAP MM 維護公司間STO報錯-No delivery type defined for supplying plant-
- java 反射 報錯:Attempt to get java.lang.Integer field "..." with illegal data type conversion to intJava反射
- .nil? .empty? .blank? .present? in Ruby on RailsAI
- 編譯錯誤--------:XX does not name a type和field `XX' has incomplete type編譯
- eclipse :報錯 ‘XXXX‘ does not name a type的解決辦法Eclipse
- vue報錯:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....VueAIGo
- SAP對PO收貨後LT06報錯-Allowed storage unit types not defined for storage type Z
- MYSQL中 TYPE=MyISAM 錯誤的解決方法MySql
- QTCreator 除錯:unknown debugger type “No engine“QT除錯
- `QtValidLicenseForCoreModule' does not name a type 錯誤的解決QTREM
- 實體類註解錯誤:Could not determine type for:
- 通俗易懂解釋一類和二類錯誤(Type I Error Type II Error)Error
- SSL - SSLHandshakeException: No subject alternative names presentException
- 啟動網路卡時報:does not seem to be present