This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Do i need to keep evrything in session!  RSS feed

 
Robin Sharma
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I am facing a peculiar problem. I am working on a JSF application and whenever i close the browser and re-open it, JBoss throws an NPE .

This happens if my backing beans are in "request" scope. The moment i put them in "session", the app runs fine.

Do i invariably have to keep all my stuff in session scope ...

Also, if i "logout" from the application, rather than closing the browser, and then open a new session, the app works.

Thanks.
 
Ellen Zhao
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you use any persistence frameworks like Hibernate?
 
Venkatraman Kandaswamy
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all having everything in session is a big waste of space - makes your development easy but it will bite you in the long run - as the app scales, more users log in - there is only so much of server memory.

Why is it NPEing? - looking at the stacktrace will give you a good idea - my initial guess is because of your code/app - also try debugging the app - so you can inspect and see where you are trying to use a null object - mostly a != null before using that object will make the problem go away- but I will look more closely to see why such a thing happened in the first place.

Good luck !! - also pasting relevant stack trace will help - but do not paste the 42 page stack trace...no one here has so much patience/time/sanity to look at such a thing.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karthik Guru

Your question is not helping this discussion. It's branching it into a new one and that is called hijacking. Please don't do that. If you have a question, feel free to start your own thread.

Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!