title: JSF 2.0 AJAX Calls Failing
body: <p>I am working on a project to take an existing project using JSF1.2, JSP, Struts, Tiles, Richfaces ... to simply use JSF2.0, the built-in facelets support, and updating Richfaces to version 4.</p>
  
  <p>So far things are going pretty well, except for one major road block. I am trying to update AJAX components that were previously being handled with the <code>&lt;a4j:support&gt;</code> tags, to the <code>&lt;f:ajax&gt;</code> tags and instead of working how I'd hope, I'm getting an error which I can only interpret as me having forgotten something in terms of configuring everything.</p>
  
  <p>It's a NullPointerException being thrown in com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter() method.</p>
  
  <p>When I load the page the first time, I can see in the debugger the component binding correctly to the backing value; the page loads without incident. It's when I try to activate the AJAX event on said component that it blows up. I get an error, and nothing updated via AJAX. It's happening with every AJAX component I try to convert. Here is one such example:</p>
  
  <pre><code>        &lt;h:selectOneMenu
          value="#{userSession.selectedNetwork}"
          id="network"
          &gt;
          &lt;f:selectItems value="#{userSession.networkUIOptions}" /&gt;
          &lt;f:ajax event="change" render="selectedStation edit_site_button add_site_button"/&gt;
      &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>I don't know if this is relevant or not, but the bean I'm referencing in that code is now annotated ala JSF2.0 and removed from faces-config.xml, however, I haven't completely gotten rid of faces-config.xml. Still working on converting everything. Also, I'm running this on Tomcat 6.0.</p>
  
  <p>Any help, suggestions would be greatly appreciated. I'm really stuck on this problem.</p>
  
  <p>EDIT 1:</p>
  
  <p>Using mojarra version 2.1.1 as per the bundle title I downloaded. Having trouble getting exact stack trace. Logging doesn't seem to be working correctly after changing so many things. Will keep trying. Also will try simple page and report results.</p>
  
  <p>EDIT 2:
  So, trying to 'minimal' page yielded the same results, same error. </p>
  
  <p>Still couldn't get logging to work exactly right, so just did some ghetto logging. See below for something resembling a proper stack trace:</p>
  
  <p>EDIT 3:
  Okay, updated ghetto stack trace with line numbers. You guessed right on the line number in the first class to toss the error:
  <a href="http://pastebin.com/49yUDcPM" rel="nofollow">http://pastebin.com/49yUDcPM</a></p>
  
  <p>doFilter function of NPNSessionFilter.java:
  <a href="http://pastebin.com/iwG0rcQ6" rel="nofollow">http://pastebin.com/iwG0rcQ6</a></p>
  
  <p>test page I created for BalusC's at suggestion:
  <a href="http://pastebin.com/kSeUyj7g" rel="nofollow">http://pastebin.com/kSeUyj7g</a></p>
  
  <p>EDIT 4:</p>
  
  <p><a href="http://tinypic.com/r/2dca0yo/7" rel="nofollow">http://tinypic.com/r/2dca0yo/7</a>
  http://tinypic.com/r/16jet7s/7</p>
  
  <p>Here are images of the libs currently packaged in the WAR's WEB-INF/lib folder. Previous programmer included a lot of junk that I haven't cleaned out yet. Likewise, not sure where struts JARs are coming from. Deleted any pre-dist JARs I could find relating to strusts or tiles.</p>
  
  <p>EDIT 5:</p>
  
  <p>Okay, breakthrough! This comment made a world of difference "Likewise, not sure where struts JARs are coming from. Deleted any pre-dist JARs I could find relating to strusts or tiles."</p>
  
  <p>Cleaned ear, re-dist, and things work better now. Obviously it wasn't just some lib I forgot to remove, but a lib I forgot to remove, and then clean the EAR out after having removed. AJAX requests are now properly going through, and I can see in the debugger values being re-bound as the request comes through! Load of other problems, but can manage those in my own time. BalusC, you led me to this solution; if you want to submit an answer I'll gladly accept it!</p>