aspose file tools*
The moose likes Java in General and the fly likes Restarting the JVM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Restarting the JVM" Watch "Restarting the JVM" New topic
Author

Restarting the JVM

Sham Phadtale
Ranch Hand

Joined: Jul 29, 2008
Posts: 75
Is it possible to restart JVM by java code?
Chinna Eranna
Ranch Hand

Joined: Dec 08, 2009
Posts: 174

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.

- Chinna
Sham Phadtale
Ranch Hand

Joined: Jul 29, 2008
Posts: 75
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

Joined: Dec 08, 2009
Posts: 174

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

Joined: Oct 05, 2001
Posts: 1170

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Restarting the JVM