This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Handling the event (if exists) when the Struts instance stops or restarts

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm having some troubles with my applicatin when a user is logged in and the instance is restarted. Obviously, the session don't survives the restart... but is there some way to send a message to the client (and maybe log out the client) when it's detect a server restart??

Thank you!!!
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not able to understand your problem can you please elaborate it more.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Matias Emanuel Serrano wrote:Hi, I'm having some troubles with my applicatin when a user is logged in and the instance is restarted. Obviously, the session don't survives the restart... but is there some way to send a message to the client (and maybe log out the client) when it's detect a server restart??

Thank you!!!




Never tried but I guess this might solve your problem

http://en.wikipedia.org/wiki/Push_technology


Please let us know what did you do finally to resolve this
 
Matias Emanuel Serrano
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My problem it's very simple:
1- I have an Instance of my application running in the server.
2- Users can login and logout normally
3- I decide for some cause to restart my server (but there are some clients who are still registered when i do this)
4- When the application restarts, the clients that were logged in before the restart, wants to do something in the application.
5- In this point, my application throws a null pointer execption when i want to get some data from the session, because i haven't got a session due the server restarts.

What i want to do, is to handle the event (if exists) when the server is stopping, and close the sessions of the clients that are logged. With this, when the instance is running again, there are not clients logged in, and the problem is solved.
 
Matias Emanuel Serrano
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rajkumar Katudia wrote:

Matias Emanuel Serrano wrote:Hi, I'm having some troubles with my applicatin when a user is logged in and the instance is restarted. Obviously, the session don't survives the restart... but is there some way to send a message to the client (and maybe log out the client) when it's detect a server restart??

Thank you!!!




Never tried but I guess this might solve your problem

http://en.wikipedia.org/wiki/Push_technology


Please let us know what did you do finally to resolve this



I will try it... thank you!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!