title: Jersey : Error creating a JAXBContext for wadl processing
body: <p>I have a REST API coded with jersey which need authentication. To authenticate you need to post to this url : <a href="http://localhost:8080/login" rel="nofollow noreferrer">http://localhost:8080/login</a> with your credentials in the body.</p>
  
  <p>It works fine when posting from an API tool like paw but I can't get it to work with Angular 5, I always get this error in the browser console :</p>
  
  <pre><code>Response to preflight request doesn't pass access control check: No 
  Access-Control-Allow-Origin' header is present on the requested resource
  </code></pre>
  
  <p>And this the the server console :</p>
  
  <pre><code>WARNING [http-nio-8080-exec-11] 
  org.glassfish.jersey.internal.Errors.logErrors The following warnings 
  have been detected: WARNING: Unknown HK2 failure detected:
  MultiException stack 1 of 2
  javax.ws.rs.ProcessingException: Error creating a JAXBContext for 
  wadl processing.
  </code></pre>
  
  <p><a href="https://pastebin.com/FtL4KAcc" rel="nofollow noreferrer">Complete Stacktrace</a></p>
  
  <p>Here's my config</p>
  
  <p>Resource :</p>
  
  <pre><code>@POST
  @Path("login")
  public Response getSession (Login login, @Context HttpServletRequest req) {
  
      System.out.println(login.getUsername());
      System.out.println(login.getPassword());
  
      LDAP ldap = new LDAP();
  
      String role = "none";
  
      try {
          if (ldap.auth(login.getUsername(), login.getPassword())) {
              role = ldap.getRole(login.getUsername());
          }
  
      } catch (Exception e) {
  
          log.error(e);
  
          throw new NotAuthorizedException(e.getMessage(), Response.Status.UNAUTHORIZED);
  
      }
  
  
      HttpSession session = req.getSession(true);
      session.setAttribute("user", login.getUsername());
      session.setAttribute("role", role);
  
      return Response.status(Response.Status.OK)
              .entity(session.getId())
              .build();
  
  }
  </code></pre>
  
  <p>Pom.xml :</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-media-json-jackson&lt;/artifactId&gt;
          &lt;version&gt;2.26&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.inject&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-hk2&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.ext&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-bean-validation&lt;/artifactId&gt;
          &lt;version&gt;2.26&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
          &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
          &lt;version&gt;2.3.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.activation&lt;/groupId&gt;
          &lt;artifactId&gt;activation&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.39&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
          &lt;version&gt;2.10.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
          &lt;version&gt;2.10.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;properties&gt;
      &lt;jersey.version&gt;2.26&lt;/jersey.version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>Angular code :</p>
  
  <pre><code>const httpOptions = {
      headers: new HttpHeaders({
          'Content-Type':  'application/json'
      })
  };
  
  login(username, password) {
      const body = JSON.stringify({'username' : username, 'password' : password});
      return this.http.post(baseURI, body, httpOptions);
  }
  </code></pre>
  
  <p>I am using Java SE 9.0.1 and angular 1.7.3</p>