Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1067857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:12:42+00:00 2026-05-16T20:12:42+00:00

I use Orchestra and RichFaces in my application. When accessing a page in my

  • 0

I use Orchestra and RichFaces in my application. When accessing a page in my application I get the following error many times and the page doesn’t load:

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

I believe at the heart the problem is a filter that I use for authentication. Here is its code (conversationController is a conversation scoped bean):

    @Override
    public void doFilter(ServletRequest request, ServletResponse response,  FilterChain chain)
    throws IOException, ServletException
    {           
        FacesContextBuilder builder = new FacesContextBuilder();

        FacesContext facesContext = builder.getFacesContext(request, response);
        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) request;
        HttpServletResponse httpResponse= (HttpServletResponse) response;

        User currentUser = sessionController.getCurrentUser();

        Boolean isTesting = (Boolean) servletContext.getAttribute("ginger.TESTING");
        if (isTesting == null) isTesting = false;

        if (currentUser == null)
        {
            if (httpRequest.isSecure() || isTesting)
            {               
                Cookie[] cookies = httpRequest.getCookies();
                Cookie cookie = null;

                if (cookies != null)
                {
                    for (int i=0; i<cookies.length; i++)
                    {
                        if (cookies[i].getName().equals("ginger.USERCOOKIE"))
                        {
                            cookie = cookies[i];
                            break;
                        }
                    }
                }

                if (cookie != null)
                {
                    currentUser = entityRegistry.getUserByCookie(cookie.getValue()); 
                }

                if (currentUser == null)
                {
                    currentUser = new UnregisteredUser();

                    String cookieValue = String.valueOf(applicationController.getRandom());

                    currentUser.setCookie(cookieValue);

                    entityRegistry.storeUser(currentUser);

                    cookie = new Cookie("ginger.USERCOOKIE", cookieValue);
                    cookie.setPath(applicationController.getPath());
                    cookie.setMaxAge(365*24*60*60);
                    if (!isTesting) cookie.setSecure(true);

                    httpResponse.addCookie(cookie);
                }

                sessionController.setCurrentUser(currentUser);

                @SuppressWarnings("unchecked")
                String url = URLConstructor.constructUrl(servletContext, httpRequest, httpResponse, false, httpRequest.getRequestURI(), httpRequest.getParameterMap());

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

                httpResponse.sendRedirect(url);
            }
        }
        else
        {
            chain.doFilter(request, response);
        }

        builder.removeFacesContext();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:12:43+00:00Added an answer on May 16, 2026 at 8:12 pm

    I solved this by releasing the FacesContext before the response is committed. Like this:

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

    I don’t understand this completely but it seems that the new request was still using the old FacesContext and this interfered with the _ReentrantLock getting unlocked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Use case: user clicks the link on a webpage - boom! load of files
use WWW::Mechanize; my $mech = WWW::Mechanize->new; $mech->get( $url ); say $mech->text; How could I
Use Elixir and have two entities -- Voter and Candidate -- with many to
Use scenario is pretty simple: I have a desktop only application that could be
Use case: 3rd party application wants to programatically monitor a text file being generated
Use of Unassigned local variable 'model'. Is what error message I'm getting. Its right
Use Html element SELECT in aspx page like: <SELECT id=MySelection name=MySelection runat=server DataValueField=ID DataTextField=Name></SELECT>
jQuery wont load. I'm a noob. Tried many things, various syntax tweaks. heres how
Use OPENXML to get dt element in MSSQL 2005. How can I get xmlns:dt
use Rack::Session::Pool ... session[:msg]=Hello Rack EDIT: The word session doesn't seem to resolve. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.