title: MessageBodyWriter not found for media type=text/html
body: <p>I am trying to integrate Jersey 2.22.2 with Jsp and Spring. I am facing some difficulties making it work. I am using Servlet 3.0 style Java configuration. I am attaching the code.</p>
  
  <pre><code>@Path("spider")
  @Template
  @Component
  @Data
  @Slf4j
  @XmlRootElement
  @XmlAccessorType(XmlAccessType.FIELD)
  public class DashboardController {
  
  @Autowired
  private SpiderWeb dashboard;
  
  private Map&lt;String, Spider&gt; spiderMap = new HashMap&lt;String, Spider&gt;();
  
  @GET
  @Path("/jsp/dashboard")
  @Produces(MediaType.TEXT_HTML)
  public Response process(@QueryParam("name") final String name,
                          @QueryParam("timeLapse") final Long timeLapse) {
      if(spiderMap.isEmpty()) {
          for (Spider spider : dashboard.getSpiders()) {
              spiderMap.put(spider.getName(), spider);
          }
      }
      if (name != null &amp;&amp; timeLapse != null &amp;&amp; spiderMap.containsKey(name)) {
         log.info("re-index  '" + name + "'");
         spiderMap.get(name).trigger(timeLapse);
      }
  
      return Response.ok().entity(new Viewable("/dashboard", dashboard)).build();
    }
  }
  </code></pre>
  
  <p>The Java config class that creates the WebappContext and registers the JspMvcFeature class and the provider packages.</p>
  
  <pre><code>package com.sky.search.spider.api;
  
  import com.xxx.search.stack.http.StackApplication;
  import com.xxx.search.stack.http.StackHttpServer;
  import org.glassfish.grizzly.http.server.HttpServer;
  import org.glassfish.grizzly.servlet.ServletRegistration;
  import org.glassfish.grizzly.servlet.WebappContext;
  import org.glassfish.jersey.server.ServerProperties;
  import org.glassfish.jersey.servlet.ServletContainer;
  import org.springframework.web.context.ContextLoaderListener;
  
  public class SpiderStackHttpServer extends StackHttpServer{
  
  
  public SpiderStackHttpServer(StackApplication application, boolean   enableJmx) {
      super(application, enableJmx);
  }
  
  
  @Override
  public void deployServletContext(HttpServer server) {
  
      WebappContext context = new WebappContext("WebappContext", "");
      context.setInitParameter("contextClass","org.springframework.web.context.support.AnnotationConfigWebApplicationContext");
  
      ServletRegistration registration = context.addServlet("ServletContainer" , ServletContainer.class);
      registration.setInitParameter(ServerProperties.PROVIDER_PACKAGES, "com.sky.search.spider.web");
      registration.setLoadOnStartup(1);
      registration.setInitParameter("jersey.config.server.mvc.templateBasePath.jsp","/WEB-INF/jsp");
      registration.setInitParameter("contextClass" , "org.springframework.web.context.support.AnnotationConfigWebApplicationContext");
      //registration.setInitParameter("contextConfigLocation" , "com.sky.search.spider.spring.ApiConfig");
      registration.setInitParameter("jersey.config.server.provider.classnames", "org.glassfish.jersey.server.mvc.jsp.JspMvcFeature");
      registration.addMapping("/jsp/dashboard/*");
  
      context.addListener(ContextLoaderListener.class);
  
      context.deploy(server);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>We are using our own Custom Java class to start the HttpServer</p>
  
  <pre><code>public StackHttpServer(StackApplication application, boolean     enableJmx) {
      GrizzlyHttpContainer container = new    GrizzlyHttpContainerProvider().createContainer(GrizzlyHttpContainer.class, application.getConfiguration());
      this.server = createHttpServer(application.getUri(), container, false, null, false);
      this.server.getServerConfiguration().setJmxEnabled(enableJmx);
      configureThreads(server);
      try {
          server.start();
          deployServletContext(server);
      } catch (final IOException ex) {
          server.shutdownNow();
          throw new ProcessingException(LocalizationMessages.FAILED_TO_START_SERVER(ex.getMessage()), ex);
      }
     }
  </code></pre>
  
  <p>So when I start the server , I am getting the following error.</p>
  
  <blockquote>
    <p>2016-02-23 18:38:05,186 ERROR
    [org.glassfish.jersey.message.internal.WriterInterceptorExecutor] -
    MessageBodyWriter not found for media type=text/html, type=class
    org.glassfish.jersey.server.mvc.Viewable, genericType=class
    org.glassfish.jersey.server.mvc.Viewable.</p>
  </blockquote>
  
  <p>I read in the Jersey website that Servlet 3.0 style won't work.
  <a href="https://jersey.java.net/documentation/latest/user-guide.html#d0e15405" rel="nofollow noreferrer">https://jersey.java.net/documentation/latest/user-guide.html#d0e15405</a>
  But I think it might be outdated and I would request your help in this regard.</p>