无法找到或提供资源



我正在Glassfish 4服务器上用Java EE 6和Primefaces制作一个Web应用程序。我越来越频繁地犯同样令人讨厌的错误。我试过用谷歌搜索这个问题,但还没有找到一个有效的解决方案。有时,应用程序的执行完全没有问题,但突然间,同样的错误一次又一次地发生。这是我的堆栈跟踪:

    WARNING:   JSF1064: Unable to find or serve resource, charts/charts.js, from library, primefaces.
WARNING:   java.io.IOException: java.util.concurrent.TimeoutException
    at org.glassfish.grizzly.utils.Exceptions.makeIOException(Exceptions.java:81)
    at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:958)
    at org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:682)
    at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:355)
    at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:342)
    at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:161)
    at java.nio.channels.Channels$WritableByteChannelImpl.write(Channels.java:458)
    at com.sun.faces.application.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:343)
    at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:153)
    at org.primefaces.application.PrimeResourceHandler.handleResourceRequest(PrimeResourceHandler.java:99)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:643)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:258)
    at java.util.concurrent.FutureTask.get(FutureTask.java:119)
    at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:951)
    ... 36 more

同样的错误会发生好几次,但无法提供资源,如:jquery/jquery-plugins.js、layout/layout.js、jquery/j query.js、primefaces.js。所有这些都来自primefaces库。

这个错误已经困扰我很长一段时间了,我们将不胜感激!

这很可能是grizzly框架的一个错误。

可能导致错误:https://java.net/jira/browse/GLASSFISH-20681?page=com.atlassian.jira.plugin.system.issuetabpanels:all-选项卡

在那个Jira中,有一个jar补丁。复制到modules目录,清除OSGI缓存(删除glassfish4\glassfish\domain1\OSGI缓存),然后重新启动。这对我有效。

另请参阅:当返回(请求)多个大型响应时,Servlet中引发GF4错误超时异常

请注意,客户端以HTTP GET请求的形式从服务器获取资源。这意味着,对于每个CSS、JS或HTML文件,都会得到一个HTTP请求。

打开浏览器web控制台并单击网络。然后去任何一个网站,你会看到你收到了多少请求。

以下是关于你的问题的一些建议。

  1. 请尝试增加服务器的最大池大小。在此处阅读http://docs.oracle.com/cd/E26576_01/doc.312/e24936/tuning-glassfish.htm#abeea->调整EJB池设置
  2. 试着分析你的网络应用程序,看看是否有太多对同一资源的请求。如上所述,您可以在浏览器中执行此操作
  3. 分析JSP中无用的导入、包含或iFrame

我希望这能帮助

相关内容

  • 没有找到相关文章

最新更新