Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Managedbean just keeps resetting  RSS feed

 
Alexander Cannell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there, i have a Managedbean and on a certain point it just keeps resetting its attributes to null. The bean is following:



I dont know wherer to start searching for the problem. If you need more information, just tell me. Thanks Edit: You can view all sources by visiting my Google Code Project:http://code.google.com/p/scrummary-the-summary/ i just committed the current sources.

Edit: "lsl" or Loginservicelocal seems to run properly, its the attributes that keep getting null for some reason. Maybe the planets are in one row or somethin.

Edit: Before i forget: i used the search, found nothing like this.
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you do have an action processor whose purpose appears to be specifically and explicitly the task of setting the properties to null. I'd pay some attention to it.

The most common reason for most Managed Beans to be zapped is that they went out of scope and were re-created. I generally include a no-argument constructor on my Managed Beans, even if it doesn't do anything. First, because it's considered good POJO practice, Second because by putting a breakpoint on the constructor I can catch stuff like that.

As a purely editorial statement I feed obligated to refer to my standard disclaimer that user-defined login/security systems are never secure.
 
Alexander Cannell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:Well, you do have an action processor whose purpose appears to be specifically and explicitly the task of setting the properties to null. I'd pay some attention to it.

The most common reason for most Managed Beans to be zapped is that they went out of scope and were re-created. I generally include a no-argument constructor on my Managed Beans, even if it doesn't do anything. First, because it's considered good POJO practice, Second because by putting a breakpoint on the constructor I can catch stuff like that.

As a purely editorial statement I feed obligated to refer to my standard disclaimer that user-defined login/security systems are never secure.


Thanks for that information, yes the constructor would be a nice debug breakpoint. I will try that.

I report back later^^

EDIT:

Here i am again. Well something strange happens, the constructor of the UserSessionService is called twice at start. I have used System.out.println(this) in the constructor and the following output is displayed:



I also let netbeans search for usages but the only usages are JSF Pages what means there is no injection or something triggering the object to be created twice.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!