JSF1064“无法找到或服务资源” jsf 2.0 的警告
我正在 Weblogic 10.3.3 上使用 Java EE 5 和 JSF 2.0 (Mojarra 2.0.3) 开发一个企业项目,
我没有错误,但在浏览我的应用程序时,控制台中出现了一个非常烦人的警告。
每当我在 JSF 中执行重定向时,我都会在控制台中收到以下形式的警告:
Nov 7, 2011 5:36:46 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/jquery-theme/ui-icons_cc0000_256x240.png.
Nov 7, 2011 5:36:46 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING:
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:507)
at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:486)
at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:580)
at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:306)
at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:146)
at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:138)
at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:275)
at com.sun.faces.application.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:277)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
但在我的应用程序中,资源显示正确。我不知道为什么当图像加载没有问题时会显示此警告。我在 Icefaces 论坛上读到,它可能与
或
标记有关。
这是我对这些标签的用法:
<h:outputStylesheet name="jquery-theme/jquery-ui-1.8.16.custom.css" library="css"/>
这些
<h:outputScript name="jquery-ui-1.8.16.custom.min.js" library="js"/>
文件分别位于 src/main/resources/css 和 src/main/resources/js 文件夹中,再一次,它们已正确加载并在页面的源代码中可见。我只是想摆脱控制台中的这些警告。
I'm working on an Enterprise project with Java EE 5 and JSF 2.0 (Mojarra 2.0.3) on Weblogic 10.3.3
I don't have an error, but a very annoying warning in my console when going through my application.
Whenever I perform a redirect in JSF, I get a warning in my console of the following form:
Nov 7, 2011 5:36:46 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING: JSF1064: Unable to find or serve resource, images/jquery-theme/ui-icons_cc0000_256x240.png.
Nov 7, 2011 5:36:46 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
WARNING:
java.net.SocketException: Software caused connection abort: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:507)
at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:486)
at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:580)
at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:306)
at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:146)
at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:138)
at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:275)
at com.sun.faces.application.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:277)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
But in my application, the resource is displayed correctly. I don't know why this warning is being shown, when the image is loaded without a problem. I've read on an icefaces forum that it might be related to the <h:outputScript/>
or the <h:outputStylesheet/>
tags.
This is my usage of these tags:
<h:outputStylesheet name="jquery-theme/jquery-ui-1.8.16.custom.css" library="css"/>
and
<h:outputScript name="jquery-ui-1.8.16.custom.min.js" library="js"/>
These files are in the src/main/resources/css
and src/main/resources/js
folders respectively, and once again, they are correctly loaded and visible in the source code of the page. I just want to get rid of these warnings in my console.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当资源仍忙于下载时,连接被中止。例如,当您导航到其他页面,或按 Esc,或者在浏览器仍忙于下载所有资源时关闭浏览器窗口时,可能会发生这种情况。
我检查了 Mojarra 源代码,并在
ResourceHandlerImpl#handleResourceRequest()
中看到以下内容(Mojarra 2.1.3 中的第 292-294 行):因此,写入响应时的
IOException
被捕获并强制处理为 404。就我个人而言,这应该被忽略或通过throws IOException
委托给 servletcontainer,而不是强行转化为HTTP 404错误。我已将其报告为问题 2245 Mojarra 人员。在那之前,您无法对其采取任何措施,但最好知道当
javax.faces.PROJECT_STAGE
设置为Production< 时,不会记录这些警告。 /code> 而不是
开发
。相反,它将被记录为FINE
。The connection was aborted while the resource was still busy downloading. That can happen when you for example navigated to a different page, or pressed Esc, or the closed the browser window while the browser is still busy downloading all resources.
I checked the Mojarra source code and see the following in
ResourceHandlerImpl#handleResourceRequest()
(lines 292-294 in Mojarra 2.1.3):So, the
IOException
on writing the response is been caught and forcibly handled as a 404. Personally, this should have been ignored or delegated to the servletcontainer bythrows IOException
, not forcibly be transformed into a HTTP 404 error.I've reported this as issue 2245 the Mojarra guys. Until then, you can't do anything much against it, but it may be good to know that those warnings won't be logged when the
javax.faces.PROJECT_STAGE
is set toProduction
instead ofDevelopment
. Instead, it will be logged asFINE
.