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

  • Home
  • SEARCH
  • 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 6781227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:35:57+00:00 2026-05-26T16:35:57+00:00

I have a @ManagedBean in my app, with the @sessionScoped anotation. The problem is

  • 0

I have a @ManagedBean in my app, with the @sessionScoped anotation.

The problem is that the public no arg constructor is being called for each request, so my fields are being reseted and my model logic goes to space.

I tried build and clean, reset glassFish, but still the bean constructor get’s called at each request.
I also have a faces-config.xml to control the page navigation.

I could solve this by redeclaring the bean inside the faces-config, now it work’s…

Any ideas of why that’s happening? If i delete the faces-config, the problem persists.

Thanks everybody!

  • 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-26T16:35:58+00:00Added an answer on May 26, 2026 at 4:35 pm

    That can happen if @SessionScoped is not of the javax.faces.bean package, but instead of a completely different API, for example the javax.enterprise.context package. Doublecheck your imports and be careful with IDE autocompletion. IDEs tend to sort autosuggestions by package name and thus the javax.enterprise.context would appear as 1st option.

    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    
    @ManagedBean
    @SessionScoped
    public class Bean {
        // ...
    }
    

    If you aren’t using any javax.faces.bean scope annotation on a @ManagedBean, then the bean will default to @NoneScoped, which means that it’s constructed on every single #{bean} EL evaluation.

    See also:

    • Every time I make an Ajax request in JSF2 I am getting a new session bean,why? (the opposite of this problem)
    • Communication in JSF 2.0 – Managed bean scopes
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a managed bean called: @ManagedBean(name=configBean) @SessionScoped public class configBean implements Serializable {
I have a JSF 2.0 bean: @ManagedBean @SessionScoped public class LoginBean implements Serializable {
I have a @ViewScope ManagedBean and a @PostConstruct initialisation method. This method is called
I have a Session scoped bean @SessionScoped public class UserData implements Serializable { private
I have a custom converter which is this : @ManagedBean @RequestScoped public class MeasureConverter
I have a strange problem. Afaik I can inject a SessionScoped bean into a
I have this Entity called 'Operation': @Entity @Table(name=operation) public class Operation implements Serializable {
I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has <p:layout> I use a
I have this bean: @ManagedBean(name=langListing) @ViewScoped public class LangListing implements Serializable { private List<SelectItem>
I have the following backing bean: @ViewScoped @ManagedBean public class WeighFamilyBacking2 implements Serializable {

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.