Reputation: 69
I have an EJB application deployed on glassfish server. Using command line, I want to change value of some static variables in the live server without doing any stop start. Is there any way to do this.
Upvotes: 0
Views: 84
Reputation: 19445
There is no way to do this in an existing application*.
You need to design and implement a mechanism for doing this yourself.
Possible techniques include:
* If you are completely desperate you could run in debug mode all the time and change the value in memory as needed by stopping the application at a suitable breakpoint.
Upvotes: 1
Reputation: 3507
You cannot change the code of a running application directly, so you need an interface. One possible interface can be the database. If the class with the static variables reads the value from the database, then you can create a small java client that updates the value in the database (per SQL update statement) and this way you can call the client per command line and give the new value per parameter on the command line.
Upvotes: 1