Jsf 管弦乐队和里奇面临的问题

Jsf 管弦乐队和里奇面临的问题,jsf,richfaces,servlet-filters,orchestra,Jsf,Richfaces,Servlet Filters,Orchestra,我在应用程序中使用了chestration和RichFaces。在我的应用程序中访问页面时,我多次出现以下错误,页面无法加载: WARN _ReentrantLock:103 - Waited for longer than 30000 milliseconds for access to lock org.apache.myfaces.orchestra.lib._ReentrantLock@78214f6b which is locked by thread http-8080-2 我相信

我在应用程序中使用了chestration和RichFaces。在我的应用程序中访问页面时,我多次出现以下错误,页面无法加载:

WARN _ReentrantLock:103 - Waited for longer than 30000 milliseconds for access to lock org.apache.myfaces.orchestra.lib._ReentrantLock@78214f6b which is locked by thread http-8080-2
我相信问题的核心是我用于身份验证的过滤器。下面是它的代码(conversationController是一个会话范围的bean):

@覆盖
public void doFilter(ServletRequest请求、ServletResponse响应、FilterChain链)
抛出IOException、ServletException
{           
FacesContextBuilder=新的FacesContextBuilder();
FacesContext FacesContext=builder.getFacesContext(请求、响应);
ServletContext ServletContext=(ServletContext)facesContext.getExternalContext().getContext();
Application Application=facesContext.getApplication();
ELContext ELContext=facesContext.getELContext();
ConversationController ConversationController=(ConversationController)application.getELResolver().getValue(elContext,null,“ConversationController”);
SessionController SessionController=(SessionController)application.getELResolver().getValue(elContext,null,“SessionController”);
ApplicationController ApplicationController=(ApplicationController)application.getELResolver().getValue(elContext,null,“ApplicationController”);
EntityRegistry EntityRegistry=conversationController.getEntityRegistry();
HttpServletRequest httpRequest=(HttpServletRequest)请求;
HttpServletResponse=(HttpServletResponse)响应;
User currentUser=sessionController.getCurrentUser();
Boolean istest=(Boolean)servletContext.getAttribute(“ginger.TESTING”);
如果(isTesting==null)isTesting=false;
if(currentUser==null)
{
if(httpRequest.isSecure()| | istest)
{               
Cookie[]cookies=httpRequest.getCookies();
Cookie=null;
如果(cookies!=null)
{

对于(int i=0;i我通过在提交响应之前释放FacesContext解决了这个问题。如下所示:

@SuppressWarnings("unchecked")
String url = URLConstructor.constructUrl(servletContext, httpRequest, httpResponse, true, httpRequest.getRequestURI(), httpRequest.getParameterMap());
builder.removeFacesContext();
httpResponse.sendRedirect(url);
我不完全理解这一点,但新的请求似乎仍在使用旧的FacesContext,这干扰了ReentrantLock的解锁

@SuppressWarnings("unchecked")
String url = URLConstructor.constructUrl(servletContext, httpRequest, httpResponse, true, httpRequest.getRequestURI(), httpRequest.getParameterMap());
builder.removeFacesContext();
httpResponse.sendRedirect(url);