Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Do i need to keep evrything in session!

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you use any persistence frameworks like Hibernate?
 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic