title: Tomcat 8 + Jersey not showing JSP pages
body: <p>I'm using Jersey for my REST application. But, one of my methods must return a Viewable that can be a simple HTML file. I have read some tutorials, and finished using an JSP template. 
  Everything is working great when I run locally, using Jetty. But, using Tomcat 8, I get the following exception:</p>
  
  <blockquote>
    <p>HTTP Status 500 - org.glassfish.jersey.server.ContainerException: javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(Ljavax/servlet/ServletConfig;)Lorg/apache/tomcat/InstanceManager;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/WEB_002dINF/jsp/confirmacao_jsp, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/apache/jasper/runtime/InstanceManagerFactory, have different Class objects for the type org/apache/tomcat/InstanceManager used in the signature</p>
    
    <p>type Exception report</p>
    
    <p>message org.glassfish.jersey.server.ContainerException:
    javax.servlet.ServletException: java.lang.LinkageError: loader
    constraint violation: when resolving method
    "org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(Ljavax/servlet/ServletConfig;)Lorg/apache/tomcat/InstanceManager;"
    the class loader (instance of org/apache/jasper/servlet/JasperLoader)
    of the current class, org/apache/jsp/WEB_002dINF/jsp/confirmacao_jsp,
    and the class loader (instance of java/net/URLClassLoader) for the
    method's defining class,
    org/apache/jasper/runtime/InstanceManagerFactory, have different Class
    objects for the type org/apache/tomcat/InstanceManager used in the
    signature</p>
    
    <p>description The server encountered an internal error that prevented it
    from fulfilling this request.</p>
    
    <p>exception</p>
    
    <p>javax.servlet.ServletException:
    org.glassfish.jersey.server.ContainerException:
    javax.servlet.ServletException: java.lang.LinkageError: loader
    constraint violation: when resolving method
    "org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(Ljavax/servlet/ServletConfig;)Lorg/apache/tomcat/InstanceManager;"
    the class loader (instance of org/apache/jasper/servlet/JasperLoader)
    of the current class, org/apache/jsp/WEB_002dINF/jsp/confirmacao_jsp,
    and the class loader (instance of java/net/URLClassLoader) for the
    method's defining class,
    org/apache/jasper/runtime/InstanceManagerFactory, have different Class
    objects for the type org/apache/tomcat/InstanceManager used in the
    signature</p>
  </blockquote>
  
  <p>My Servlet configuration is:</p>
  
  <pre><code>&lt;servlet&gt;
          &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
              &lt;param-value&gt;gs.relferreira.corporativo.rest;org.codehaus.jackson.jaxrs&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
              &lt;param-value&gt;gs.relferreira.corporativo.rest.RelferreiraApplication&lt;/param-value&gt;           
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;jersey.config.server.mvc.templateBasePath.jsp&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/jsp/&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;jersey.config.server.provider.classnames&lt;/param-name&gt;
              &lt;param-value&gt;org.glassfish.jersey.server.mvc.jsp.JspMvcFeature&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;com.sun.jersey.config.servlet.filter.staticContentRegex&lt;/param-name&gt;
              &lt;param-value&gt;/resources/(images|css)/. &lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  </code></pre>
  
  <p>And the method that return a view is the following:</p>
  
  <pre><code>@GET
      @Path("confirmar/{idUsuario}/{token}")
      @Produces(MediaType.TEXT_HTML)
      public Viewable validarEmail(@PathParam("idUsuario") int idUsuario, @PathParam("token") String token){      
          if(m_Controlador.validarEmail(idUsuario, token))
              return new Viewable("/confirmacao.jsp", null);
          else 
              return new Viewable("/erro.jsp", null);
      }
  </code></pre>