title: IceFaces / JSF CSS parsing problem: Content is not allowed in prolog
body: <p>I'm having issues with an IceFaces / JSF application. We have an IceFaces InputRichText component that is causing a lot of pain. <strong>Sometimes</strong> the page containing the component throws this exception and the page loading fails (it becomes all white):</p>
  
  <pre><code>[#|2010-03-18T10:44:40.197+0100|SEVERE|sun-appserver2.1|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=14;_ThreadName=httpSSLWorkerThread-80-0;RENDER_RESPONSE 6;/css/fck_editorarea.css;javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@75932728];_RequestID=45f3c97c-5cfc-4f25-a636-e76ec6b346eb;|JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /css/fck_editorarea.css) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@75932728]|#]
  [#|2010-03-18T10:44:40.204+0100|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=14;_ThreadName=httpSSLWorkerThread-80-0;_RequestID=45f3c97c-5cfc-4f25-a636-e76ec6b346eb;|StandardWrapperValve[Blocking Servlet]: PWC1406: Servlet.service() for servlet Blocking Servlet threw exception
  java.lang.Exception: javax.faces.FacesException: Problem in renderResponse: Error Parsing /css/fck_editorarea.css: Error Traced[line: 1] Content is not allowed in prolog.
  at com.icesoft.faces.context.View.servePage(View.java:152)
  at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:67)
  at com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11)
  at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:149)
  at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
  at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
  at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
  at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
  at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:26)
  at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
  at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
  .
  .
  .
  Caused by: com.sun.facelets.FaceletException: Error Parsing /css/fck_editorarea.css: Error Traced[line: 1] Content is not allowed in prolog.
  at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:239)
  </code></pre>
  
  <p>Other times the loadin of the page works like a charm. To me it seems that the server for some reason tries to parse the CSS file as XML, which of course is doomed to fail miserably.</p>
  
  <p>I have tried changing the servlet mappings in the web.xml file, as I've read reports on the Internet that it might fix the issue, but to no avail.</p>
  
  <p>The servlet mappings section of the web.xml file is below:</p>
  
  <pre><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Persistent Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/xmlhttp/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Persistent Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.iface&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Persistent Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jspx&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Blocking Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/block/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;uploadServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/uploadHtml&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;*.jspx&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Persistent Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jspx&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>We've also only ever encountered this on our servers (running CentOS and Windows 2k8), never on our dev machines (running XP and Vista). The only differance I can think of is that the servers run 64-bit JDK's. </p>
  
  <p>Any ideas as to what might be going on?</p>
  
  <p>EDIT:</p>
  
  <p>Just noticed this in the server logs:</p>
  
  <pre><code>2010-03-18 07:55:04,914 ERROR com.icesoft.faces.context.View.serve(83) Exception occured during rendering on http://XXX.XXX.XXX.XXX/block/css/fck_editorarea.css [/css/fck_editorarea.css]
  </code></pre>
  
  <p>javax.faces.FacesException: Problem in renderResponse: Error Parsing /css/fck_editorarea.css: Error Traced[line: 1] Content is not allowed in prolog.</p>
  
  <p>Could it be that the "Blocking Servlet" mapping needs to be changed in some way?</p>
  
  <p>Thanks!</p>