I want to create a little REST application that respond to request with xml. The basic configuration of my application that returns normal strings works fine.
I added the following in my pom.xml in order to add support to xml:
<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-core</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>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
<version>1.2.0</version>
</dependency>
But I still have the following error when the tomcat server in eclipse loads the application:
java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext
My system configuration:
java --version
openjdk 10.0.1 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10)
OpenJDK 64-Bit Server VM (build 10.0.1+10, mixed mode)
eclipse Version: Photon Release (4.8.0)
tomcat 8.5