IceFaces / JSF CSS解析问题:序言中不允许内容
我在使用 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]序言中不允许内容。
是否需要以某种方式更改“Blocking Servlet”映射?
谢谢!
I'm having issues with an IceFaces / JSF application. We have an IceFaces InputRichText component that is causing a lot of pain. Sometimes the page containing the component throws this exception and the page loading fails (it becomes all white):
[#|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)
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.
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.
The servlet mappings section of the web.xml file is below:
<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>
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.
Any ideas as to what might be going on?
EDIT:
Just noticed this in the server logs:
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: Problem in renderResponse: Error Parsing /css/fck_editorarea.css: Error Traced[line: 1] Content is not allowed in prolog.
Could it be that the "Blocking Servlet" mapping needs to be changed in some way?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论