ClassNotFoundException for javax.xml.bind.JAXBException with Spring Boot when switch to Java 9

后端 未结 6 1854
闹比i
闹比i 2020-12-14 16:00

Initialized the project using start.spring.io

Added WEB,JPA,H2 dependencies then tried to run the MainApplication.java using Jdk

6条回答
  •  死守一世寂寞
    2020-12-14 16:30

    Add below maven dependencies in you pom.xml and the issue will get resolve. in Java9/10 JaxB modules has been removed, hence need to add manually.

    
      javax.xml.bind
      jaxb-api
      2.2.11
    
    
      com.sun.xml.bind
      jaxb-core
     2.2.11
    
    
      com.sun.xml.bind
      jaxb-impl
      2.2.11
     
    
      javax.activation
      activation
      1.1.1
    
    
      com.fasterxml.jackson.dataformat
      jackson-dataformat-xml
    
    

提交回复
热议问题