title: Exception on redirect to <error-page> configured (HTTP 500)
body: <p>I'm having problems when redirecting to error-page configured  in web.xml (HTTP 500).
  The following exception is being thrown</p>
  
  <pre><code>java.lang.NullPointerException at java.lang.StringBuilder.&lt;init&gt;(StringBuilder.java:77) 
  at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.getRenderedViewId(FaceletViewDeclarationLanguage.java:1674)
  FullAjaxExceptionHandler: Well, another exception occurred during rendering error page 'comum/paginas/erro/erro500.xhtml'. Trying to render a hardcoded error page now.
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;error-page&gt;
      &lt;exception-type&gt;javax.faces.application.ViewExpiredException&lt;/exception-type&gt;
      &lt;location&gt;comum/paginas/erro/sessaoExpirada.xhtml&lt;/location&gt;
  &lt;/error-page&gt;
  &lt;error-page&gt;
      &lt;exception-type&gt;java.lang.Throwable&lt;/exception-type&gt;
      &lt;location&gt;comum/paginas/erro/erro500.xhtml&lt;/location&gt;
  &lt;/error-page&gt;
  &lt;error-page&gt;
      &lt;error-code&gt;500&lt;/error-code&gt;
      &lt;location&gt;comum/paginas/erro/erro500.xhtml&lt;/location&gt;
  &lt;/error-page&gt;
  &lt;error-page&gt;
      &lt;error-code&gt;403&lt;/error-code&gt;
      &lt;location&gt;comum/paginas/erro/erro403.xhtml&lt;/location&gt;
  &lt;/error-page&gt;
  &lt;error-page&gt;
      &lt;error-code&gt;404&lt;/error-code&gt;
      &lt;location&gt;comum/paginas/erro/erro404.xhtml&lt;/location&gt;
  &lt;/error-page&gt;
  </code></pre>
  
  <p>FullAjaxExceptionHandlerFactory was configured in faces-config.xml.</p>
  
  <pre><code>&lt;factory&gt;
      &lt;exception-handler-factory&gt;org.omnifaces.exceptionhandler.FullAjaxExceptionHandlerFactory&lt;/exception-handler-factory&gt;
  &lt;/factory&gt;
  </code></pre>
  
  <p>My facelets components are packaged in a jar file (/META-INF/resources/comum/paginas/erro). 
  ResourceResolver</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;javax.faces.FACELETS_RESOURCE_RESOLVER&lt;/param-name&gt;
      &lt;param-value&gt;company.FaceletsResourceResolver&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  public class FaceletsResourceResolver extends ResourceResolver {
  
      private ResourceResolver parent;
      private String basePath;
  
      public FaceletsResourceResolver(ResourceResolver parent) {
          this.parent = parent;
          this.basePath = "/META-INF/resources";
      }
  
      @Override
      public URL resolveUrl(String path) {
          URL url = parent.resolveUrl(path); // Resolves from WAR.
          if (url == null) {
              url = getClass().getResource(basePath + path); // Resolves from JAR.
          }
          return url;
      }
  }
  </code></pre>
  
  <p>When facelets components were not packaged in a jar, the redirect worked properly.
  The other error pages (403, 404, sessionExpired) work without problems. 
  The error only occurs with the HTTP 500 error.</p>
  
  <p>Environment:</p>
  
  <ul>
  <li>Websphere 8.5.5.2</li>
  <li>JSF 2.0 (myfaces)</li>
  <li>Primefaces 5.0 </li>
  <li>Omnifaces 1.7</li>
  </ul>