问题:
测试接口时控制台抛出:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter] with root cause。
原因:
JDK9 中引入了模块的概念,默认情况下,Java SE中将不再包含java EE 的Jar包。
解决办法:
手动添加依赖:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
添加后接口测试成功: