在UIComponent.popComponentFromEL处停滞线程
我的应用程序在PrimeFaces中使用JSF 2.1。 最近,由于一些卡住的线程,观察到CPU利用率非常高。 卡住的线程转储为所有卡住的线程指向javax.faces.component.UIComponent.popComponentFromEL
如下所示:
javax.faces.component.UIComponent.popComponentFromEL(UIComponent.java:1934)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1633)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
org.primefaces.component.api.UIData.visitRows(UIData.java:741)
org.primefaces.component.api.UIData.visitTree(UIData.java:656)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
org.primefaces.component.accordionpanel.AccordionPanel.visitTree(AccordionPanel.java:371)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIForm.visitTree(UIForm.java:371)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
com.sun.faces.application.view.StateManagementStrategyImpl.findComponent(StateManagementStrategyImpl.java:440)
com.sun.faces.application.view.StateManagementStrategyImpl.restoreDynamicRemove(StateManagementStrategyImpl.java:412)
com.sun.faces.application.view.StateManagementStrategyImpl.restoreDynamicActions(StateManagementStrategyImpl.java:317)
com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:281)
com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:453)
com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:142)
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:77)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
com.ultimatix.bgc.framework.GBGCSessionControllerFilter.doFilter(GBGCSessionControllerFilter.java:90)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
com.ultimatix.framework.jsf.util.ForcedLoginFilter.doFilter(ForcedLoginFilter.java:505)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
com.ultimatix.framework.jsf.util.IndexFilter.doFilter(IndexFilter.java:338)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
com.ultimatix.framework.jsf.util.SecurityInterceptor.doFilter(SecurityInterceptor.java:40)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
这是如何造成的,我该如何解决这个问题?
根据Mojarra问题2722,当您错误地将组件实例绑定到托管bean的bean属性时,会发生这种情况,该托管bean不是请求范围,而是范围更广。
<x:someComponent binding="#{viewOrSessionOrApplicationScopedBean.component}" />
相应地修复代码,这永远不会发生。 组件本质上是请求范围的,可能绝对不能在多个请求之间共享。 另请参见JSF 2.0 specitication一章3.1.5:
3.1.5组件绑定
...
组件绑定通常与通过Managed Bean Creation工具动态实例化的JavaBean结合使用(请参见第5.8.1节“VariableResolver和Default VariableResolver”)。 强烈建议应用程序开发人员在“请求”范围内放置组件绑定表达式指向的受管Bean。 这是因为将它放在会话或应用程序范围内会需要线程安全性,因为UIComponent实例依赖于在单个线程内运行。 将组件绑定放置在“会话”范围内时,也会对内存管理产生潜在的负面影响。
也可以看看:
上一篇: Stuck thread at UIComponent.popComponentFromEL
下一篇: how to keep comments