我遇到了 IceFaces / JSF 应用程序的问题。我们有一个 IceFaces InputRichText 组件,它造成了很多痛苦。有时包含该组件的页面会抛出此异常,导致页面加载失败(变为全白):
[#|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)
其他时候,页面的加载就像一个魅力。在我看来,服务器似乎出于某种原因试图将 CSS 文件解析为 XML,这当然注定要惨败。
我已经尝试更改 web.xml 文件中的 servlet 映射,因为我在 Internet 上阅读了可能解决问题的报告,但无济于事。
web.xml 文件的 servlet 映射部分如下:
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/uploadHtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
我们也只在我们的服务器(运行 CentOS 和 Windows 2k8)上遇到过这种情况,从来没有在我们的开发机器上(运行 XP 和 Vista)。我能想到的唯一区别是服务器运行 64 位 JDK。
关于可能发生什么的任何想法?
编辑:
刚刚在服务器日志中注意到这一点:
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]
javax.faces.FacesException:renderResponse 中的问题:解析错误 /css/fck_editorarea.css:错误跟踪 [行:1] prolog 中不允许内容。
是否需要以某种方式更改“阻塞 Servlet”映射?
谢谢!