This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Restarting the JVM

 
Sham Phadtale
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to restart JVM by java code?
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java cannot restart itself. Why do you want to do that ?

You may want to wrap the jvm in some script like shell script in unix.
 
Sham Phadtale
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Swing client and JBoss server. I want to reset password and then restart the client.

After password reset if I use System.exit() and restart the client manually(double click on exe.)application works with new credentials. I get desired information from server.

But when I reset password and then open the login window programatically(that is in code after resetting password without using System.exit()) I am not able to get access of server. Client still uses old credentials which are invalid and so resulting in server error saying - User Invalid.

I just want that after password reset user should get Login page automatically without double click on exe.
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sham Phadtale wrote:Client still uses old credentials which are invalid and so resulting in server error saying - User Invalid.


Assuming your client is completely in Java, Why will it use old credentials ? Probably some cache is not being updated.
I believe, you should fix this problem, rather looking for restarting the application.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even if you could pull that off, it would still be in the credentials of the original starter. If you are trying to change credentials, you need to get something to start up that does not already have credentials associated with it. Your going to need the OS to do this for you. Probably a script.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic