title: NullPointerException when using navigation-case
body: <p>I have this in my faces-config.xml:</p>
  
  <pre><code>&lt;navigation-rule&gt;
      &lt;from-view-id&gt;*&lt;/from-view-id&gt;
      &lt;navigation-case&gt;
          &lt;from-outcome&gt;login&lt;/from-outcome&gt;
          &lt;to-view-id&gt;/login.xhtml&lt;/to-view-id&gt;
          &lt;redirect/&gt;
      &lt;/navigation-case&gt;
      &lt;navigation-case&gt;
          &lt;from-outcome&gt;index&lt;/from-outcome&gt;
          &lt;to-view-id&gt;/index.xhtml&lt;/to-view-id&gt;
          &lt;redirect/&gt;
      &lt;/navigation-case&gt;
  &lt;/navigation-rule&gt;
  </code></pre>
  
  <p>When I go to the one of this pages, I get this exception:</p>
  
  <pre><code>Error Rendering View[/index.xhtml]
  java.lang.NullPointerException
      at com.sun.faces.application.NavigationHandlerImpl.determineViewFromActionOutcome(NavigationHandlerImpl.java:1271)
      at com.sun.faces.application.NavigationHandlerImpl.findWildCardMatch(NavigationHandlerImpl.java:660)
      at com.sun.faces.application.NavigationHandlerImpl.getViewId(NavigationHandlerImpl.java:482)
      at com.sun.faces.application.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:148)
      at com.sun.faces.application.NavigationHandlerImpl.getNavigationCase(NavigationHandlerImpl.java:139)
      at com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer.getNavigationCase(OutcomeTargetRenderer.java:146)
      at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.encodeBegin(OutcomeTargetLinkRenderer.java:85)
      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1894)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:451)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>Line 1270 (<a href="http://grepcode.com/file/repo1.maven.org/maven2/org.glassfish/javax.faces/2.2.1/com/sun/faces/application/NavigationHandlerImpl.java#1200" rel="nofollow">1200</a> in 2.2.1) is</p>
  
  <pre><code>FlowHandler fh = ctx.getApplication().getFlowHandler();
  </code></pre>
  
  <p>It returns null and causes a NullPointerException on the next line.
  Glassfish 4.0.0, JDK 1.7.0_40, JSF 2.2.4 (2.2.1 was before edits, but I didn't know that Glassfish had 2.2.0), Ubuntu 12.10 64bit. What's wrong?</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
            http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
             version="3.0"&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.faces&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I caught this error after fixing another error.</p>