上QQ阅读APP看书,第一时间看更新
Tackling JAXBException
The following exception can be expected as soon as a Spring Boot 2.0 application is run on Java 9:
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
This is because Hibernate requires JAXB, which is not shipped by default in Java 9. The following dependency needs to be added in pom.xml to include it:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
Instead, you can add the java.xml.bind module to Java 9 directly to get rid of this exception.