To illustrate my issue, I created a small spring boot sample application. The purpose of the application is to create a Jaxb2Marshaller
bean.
@S
The following has worked for me
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.0</version>
</dependency>
Try adding the following:
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency>
jaxb-core
contains com.sun.xml.bind.v2.model.annotation.AnnotationReader
(and seems to be a required dependency of jaxb-runtime
, at least in your case), while javax.activation
is needed by jaxb-api
due to the usage of DataHandler
by the latter.
Also, there is no a single bean class, so the marshaller will fail initialization. I've added the following
@XmlRootElement
public class MyBean {
}
and replaced
bean.setContextPath("ch.sahits.game.helloworld");
with
bean.setClassesToBeBound(MyBean.class);
after which the application has started.