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 8476675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:14:43+00:00 2026-06-10T18:14:43+00:00

I am using primefaces 3.2, i have a problem while using a thread in

  • 0

I am using primefaces 3.2, i have a problem while using a thread in JSF. I couldn’t get a reference to the current FacesContext from that thread.

How to get a reference to that context inside that thread.

  • 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-06-10T18:14:45+00:00Added an answer on June 10, 2026 at 6:14 pm

    The current FacesContext is stored in a static thread-local variable. Servlet containers use a specific thread to process each request/response that arrives to the container so, storing the FacesContext in a thread-local variable ensures that there is just one instance per request processing lifecycle, which is how it should be.

    When you try to obtain a reference to a FacesContext from another thread what happens is, since the it’s stored as a thread-local variable and since your new thread didn’t initialized it yet: you obtain a null reference.

    If you want/need a faces context in another new thread the only possible way is to create a new context instance by means of the FacesContextFactory. However you will need a reference to a HttpServletRequest, a HttpServletResponse and a ServletContext to instantiate it (and I guess you won’t be able to get valid references to those objects from a separate thread).

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

Sidebar

Related Questions

I am working with MyFaces/Primefaces and I have a problem to get information using
I have a problem using JSF 2.0, PrimeFaces and the tuckey.org UrlRewriteFilter. The problem
I recently migrated my JSF app(using primefaces) from glassfish 3.1 to tomcat7 server. Previously
I have a modal ConfirmDialog that is shown over a modal Dialog using PrimeFaces
I have a JSF 2.0 page that I want to allow a GET parameter
am usign jsf 2.0 + primefaces 3.2. i have a problem with filterBy when
i have problem with load data from Database i use Primefaces (or other use
I am using PrimeFaces 3.2 with JSF 2 in a glassfish 3.1.2. I have
so the problem is pretty simple: We are using JSF 2.0 with Primefaces and
I am using Primefaces 3.2 with jsf 2 and glassfish 3.1.2. I have a

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.