title: WARNING: Provider com.sun.xml.internal.bind.v2.ContextFactory not found
body: <p>I have integrated within a JSF app a few webservices through <code>Jersey</code>.  Everything works fine, even the OAuth identification is working.  BUT! When starting my webserver, I ALWAYS get this error : </p>
  
  <pre><code>INFO: Scanning for root resource and provider classes in the packages:
    com.mysite.webService
  INFO: Root resource classes found:
    class com.mysite.webService.Accounts
  INFO: No provider classes found.
  
  INFO: Initiating Jersey application, version 'Jersey: 1.17 01/17/2013 03:31 PM'
  </code></pre>
  
  <p><strike></p>
  
  <pre><code>SEVERE: The provider class, class com.sun.jersey.oauth.server.OAuthProviderInjectionProvider, could not be instantiated. Processing will continue but the class will not be utilized
  java.lang.RuntimeException: No OAuthProvider implementation found in the list of providers.
      at com.sun.jersey.oauth.server.OAuthProviderInjectionProvider.&lt;init&gt;(OAuthProviderInjectionProvider.java:71)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  </code></pre>
  
  <p></strike></p>
  
  <p><em>(edit2: above is now solved)</em></p>
  
  <p>and this warning: </p>
  
  <pre><code>...
  
  WARNING: Provider com.sun.xml.internal.bind.v2.ContextFactory not found
  javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory not found
   - with linked exception:
  [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory not found by com.sun.jersey.glassfish.v3.osgi.jersey-gf-server [157]]
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:148)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:361)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
      at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.&lt;init&gt;(WadlApplicationContextImpl.java:95)
  </code></pre>
  
  <p>Here is my <code>web.xml</code> relevant entries : </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
          &lt;param-value&gt;my.site.webService&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>My classes look as such : </p>
  
  <pre class="lang-java prettyprint-override"><code>@Path("/rest")
  public class MyClass {
  
      @GET 
      @Path("/{id}/results")
      @Produces("application/json")
      public String getResults(@Context HttpContext hc, @PathParam("id")) {
          //...
      }
  }
  </code></pre>
  
  <p>I am using <code>Majorra 2.1.20</code> on <code>Glassfish 2.1.2.2</code> with <code>PrimeFaces 3.4.1</code> and <code>Jersey 1.17</code> as addons.  Developping in <code>Eclipse Juno</code> if this affects anything.</p>
  
  <h3>Edit</h3>
  
  <p>This does not prevent me from having everything in working order with regards to webservices.  But everytime I republish something on Glassfish, the error shows up.</p>
  
  <p>As mentioned in an answer below, this should have been fixed in version 1.7 according to <a href="http://java.net/jira/browse/JERSEY-709" rel="nofollow noreferrer">JIRA bug JERSEY-709</a>.  But I am very well on v. 1.17 and I'm still getting this.</p>
  
  <p>I have also added a Warning I am getting within the stack trace.  If this can help determine the issue!</p>
  
  <p>Searching the web : I have found <a href="http://jersey.576304.n2.nabble.com/Upgraded-Jersey-to-1-15-in-glassfish-3-1-2-2-Getting-org-jboss-weld-resources-spi-ResourceLoadingExcs-td7580264.html" rel="nofollow noreferrer">The same unresolved issue here</a></p>
  
  <h3>Edit 2</h3>
  
  <p>As answered below, updating my <code>OAuthClient.jar</code> did solve the first <code>error</code>.  I am STILL getting the <code>WARNING: Provider com.sun.xml.internal.bind.v2.ContextFactory not found</code>.</p>
  
  <h3>Edit 3 - Attempted Solution</h3>
  
  <p>Tried updating JAXB after what I thought would be a lead on <a href="https://stackoverflow.com/questions/3093963/java-class-using-jaxb-api-failing-in-jira-with-provider-com-sun-xml-bind-v2-co">this question</a>.  This did not lead to anything successful. Same warning.  When removing the Jersey bits in my <code>web.xml</code> this warning stops showing (just to confirm this is really initiating the issue).</p>