JSF1064“无法找到或提供资源"关于jsf 2.0的警告 [英] JSF1064 "Unable to find or serve resource" warning on jsf 2.0

查看:302
本文介绍了JSF1064“无法找到或提供资源"关于jsf 2.0的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Weblogic 10.3.3上使用Java EE 5和JSF 2.0(Mojarra 2.0.3)进行企业项目开发

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.

每当我在JSF中执行重定向时,都会在控制台中收到以下格式的警告:

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)

但是在我的应用程序中,资源显示正确.我不知道为什么在加载图像没有问题时会显示此警告.我在icefaces论坛上读到它可能与<h:outputScript/><h:outputStylesheet/>标记有关.

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"/>

<h:outputScript name="jquery-ui-1.8.16.custom.min.js" library="js"/>

这些文件分别位于src/main/resources/csssrc/main/resources/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.

推荐答案

java.net.SocketException:软件导致连接中止:套接字写入错误

java.net.SocketException: Software caused connection abort: socket write error

在资源仍在忙下载的同时,连接被中止.例如,当您导航到其他页面或按 Esc 或在浏览器仍在忙于下载所有资源时关闭浏览器窗口时,就会发生这种情况.

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.

我检查了Mojarra源代码,并在ResourceHandlerImpl#handleResourceRequest()中看到了以下内容(Mojarra 2.1.3中的292-294行):

I checked the Mojarra source code and see the following in ResourceHandlerImpl#handleResourceRequest() (lines 292-294 in Mojarra 2.1.3):

} catch (IOException ioe) {
    send404(context, resourceName, libraryName, ioe, true);
}

因此,在编写响应时IOException被捕获并被强制作为404处理.就个人而言,throws IOException应该将其忽略或委托给servlet容器,而不是被强制转换为HTTP 404错误.

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 by throws IOException, not forcibly be transformed into a HTTP 404 error.

我将其报告为Mojarra伙计们 issue 2245 .在此之前,您不能对此采取任何措施,但是最好将javax.faces.PROJECT_STAGE设置为Production而不是Development时不会记录这些警告.而是将其记录为FINE.

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 to Production instead of Development. Instead, it will be logged as FINE.

这篇关于JSF1064“无法找到或提供资源"关于jsf 2.0的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆