我遇到了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映射,因为我已经在互联网上阅读了它可能解决问题的报告,但无济于事。
web.xml文件的servlet mappings部分如下:
<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:错误跟踪[line:1] prolog中不允许内容。
是否需要以某种方式更改“阻止Servlet”映射?
谢谢!