title: JDK11 + spring boot = JAXBException: Implementation of JAXB-API has not been found on module path or classpath
body: <p>I have a simple spring project based on the <a href="https://spring.io/guides/gs/consuming-web-service/" rel="noreferrer">official guide</a> to consume a web service. This sample seems to be targeting JDK 8 but I want to use the latest LTS, JDK 11.</p>
  
  <p>I have adapted the <code>pom.xml</code> file and added some dependencies which seem to have been removed from the JDK, namely:</p>
  
  <pre class="lang-xml prettyprint-override"><code>        &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jaxb&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-core&lt;/artifactId&gt;
              &lt;version&gt;2.3.0.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jaxb&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-runtime&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.xml.ws&lt;/groupId&gt;
              &lt;artifactId&gt;rt&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.activation&lt;/groupId&gt;
              &lt;artifactId&gt;javax.activation&lt;/artifactId&gt;
              &lt;version&gt;1.2.0&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>However, I can't seem to start the application, I always get this error:</p>
  
  <pre class="lang-java prettyprint-override"><code>➜  spring-test git:(master) mvn spring-boot:run
  [INFO] Scanning for projects...
  ...
  org.springframework.ws.soap.client.SoapFaultClientException: Implementation of JAXB-API has not been found on module path or classpath.
      at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault (SoapFaultMessageResolver.java:38)
      at org.springframework.ws.client.core.WebServiceTemplate.handleFault (WebServiceTemplate.java:830)
      at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive (WebServiceTemplate.java:624)
      at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive (WebServiceTemplate.java:555)
      at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive (WebServiceTemplate.java:390)
      at com.example.demo.CountryClient.getCountry (CountryClient.java:21)
      at com.example.demo.DemoApplication.lambda$lookup$0 (DemoApplication.java:24)
      at org.springframework.boot.SpringApplication.callRunner (SpringApplication.java:781)
      at org.springframework.boot.SpringApplication.callRunners (SpringApplication.java:765)
      at org.springframework.boot.SpringApplication.run (SpringApplication.java:319)
      at org.springframework.boot.SpringApplication.run (SpringApplication.java:1215)
      at org.springframework.boot.SpringApplication.run (SpringApplication.java:1204)
      at com.example.demo.DemoApplication.main (DemoApplication.java:13)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:566)
      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:543)
      at java.lang.Thread.run (Thread.java:834)
  </code></pre>
  
  <p>Although there are at least two questions (<a href="https://stackoverflow.com/questions/51916221/javax-xml-bind-jaxbexception-implementation-of-jaxb-api-has-not-been-found-on-mo">this</a> and <a href="https://stackoverflow.com/questions/54632086/java-11-implementation-of-jaxb-api-has-not-been-found-on-module-path-or-classpa">this</a>) related to this topic, I've tried all combinations of versions that I could find in those posts and I still have the same error.</p>
  
  <p>The specific JDK+maven version I'm using is:</p>
  
  <pre><code>Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T16:06:16+01:00)
  Maven home: /usr/local/Cellar/maven/3.6.2/libexec
  Java version: 11.0.4, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home
  Default locale: en_US, platform encoding: UTF-8
  OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
  </code></pre>
  
  <p>And the code for my test is <a href="https://github.com/edevil/spring-test" rel="noreferrer">here</a>.</p>