title: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector not found --- while using Swagger
body: <p>my first post on SO and expecting good stuff in return :-)</p>
  
  <p>I have developed a small java restful services app and integrated with Swagger. I have @Controller -> @Service -> @Repository architecture. I have deployed on Glassfish (4.1.1), when I use Chrome's 'Advanced Rest Client', I am able to perfectly send and receive rest calls (GET/POST etc), but when I use Swagger, it throws the following exception 'after Controller returns the correct response'.</p>
  
  <p>I have been struggling with this by changing the maven entry versions, changing the moxy jar, delting felix as suggested in some forums etc, none seem to help.</p>
  
  <p>Here are more details ...</p>
  
  <h2>Exception:</h2>
  
  <pre><code>  StandardWrapperValve[com.xxx.config.ApplicationConfig]: Servlet.service() for servlet com.xxx.config.ApplicationConfig threw exception
  java.lang.ClassNotFoundException: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector not found by com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider [130]
      at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
      at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
      at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  </code></pre>
  
  <h2>Code:</h2>
  
  <pre><code>@Controller
  @Path("/document")
  @Api(value = "/document", description = "Document Controller ")
  public class DocumentController {
  
      @Inject
      DocumentService documentService;
  
      @GET
      @Path("/{id}")
      @Produces(MediaType.APPLICATION_JSON)
      @ApiOperation(value = "Get Document.", notes = "Get Document Call")
      @ApiResponses(value = { @ApiResponse(code = 200, message = "OK"),
              @ApiResponse(code = 500, message = "Something wrong in Server") })
      public DtoDocument getDocument(@PathParam("id") Integer docId) {
          Document doc = documentService.getDocument(docId);
          DtoDocument dto = toDto(doc);
          return dto;
      }
  }
  
  @Service
  @Transactional
  public class DocumentService {
  
      @Inject
      DocumentRepository repository;
  
      public Document getDocument(Integer id) {
          return repository.getDocumentById(id);
      }
  
  }
  
  @Repository
  public class DocumentRepository {
  
      public static final String COLLECTION_NAME = "document";
  
      @Inject
      private MongoTemplate mongoTemplate;
  
      public Document getDocumentById(Integer Id) {
          Document doc = getMongoTemplate().findOne(Query.query(Criteria.where("id").is(Id)), Document.class, COLLECTION_NAME);
          return doc;
      }
  
  }
  
  @ApplicationPath("/rest")
  public class ApplicationConfig extends Application {
  
      @Override
      @SuppressWarnings({ "unchecked", "rawtypes" })
      public Set&lt;Class&lt;?&gt;&gt; getClasses() {
          Set&lt;Class&lt;?&gt;&gt; resources = new java.util.HashSet();
  
          resources.add(com.wordnik.swagger.jaxrs.listing.ApiListingResource.class);
          resources.add(com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider.class);
          resources.add(com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON.class);
          resources.add(com.wordnik.swagger.jaxrs.listing.ResourceListingProvider.class);
  
          addRestResourceClasses(resources);
  
          return resources;
      }
  
      private void addRestResourceClasses(Set&lt;Class&lt;?&gt;&gt; resources) {
          // Custom resources in the project (all restful services)
          resources.add(com.xxx.web.rest.DocumentController.class);
      }
  
  }
  </code></pre>
  
  <p>beans.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
      bean-discovery-mode="all"&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>swagger entry in the pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;com.wordnik&lt;/groupId&gt;
              &lt;artifactId&gt;swagger-jersey-jaxrs_2.10&lt;/artifactId&gt;
              &lt;version&gt;1.3.13&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
                      &lt;artifactId&gt;jersey-spring&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
                      &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
                      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
                      &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
                      &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
                      &lt;artifactId&gt;jersey-multipart&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
                      &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
                      &lt;artifactId&gt;guava&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.fasterxml.jackson.module&lt;/groupId&gt;
                      &lt;artifactId&gt;jackson-module-jaxb-annotations&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Appreciate if anyone can tell me what exactly is the issue ... its been a frustrating week &amp; am stuck with this, not making any progress.</p>