-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Payara Micro can't be stopped and restarted in the same process #588
Comments
There are 2 scenarios here (1) Invoking PayaraMicro.getInstance().shutdown() - this would give you a BootstrapException with a ‘Already bootstrapped’ message. The actual source is the following - https://github.com/payara/Payara/blob/8a403bf75d3734e564a9fb95d60498987cc4287e/nucleus/common/simple-glassfish-api/src/main/java/org/glassfish/embeddable/GlassFishRuntime.java Upon further examination, I found the that calling Glassfish.dispose (from shutdown method in PayaraMicroRuntime does not suffice). Calling GlassFishRuntime.shutdown() internally calls dispose on the GlassFish instance. Currently, the instance of GlassFishRuntime is encapsulated within the PayaraMicro class and is not available to PayaraMicroRuntime which hinders a clean shutdown. (2) Calling a shutdown on PayaraMicroRuntime instance which is obtained using PayaraMicro.getInstance().bootStrap() [This prompts the exception which Stevel mentioned] The GlassFish instance (‘runtime’ variable in the PayaraMicro) needs to be set to null after the completion of shutdown method. This will clear the exception mentioned in the issue I think that the capability of being able to invoke shutdown in more than one way might cause issues. It should have been encapsulated within one class and exposed publicly. Thoughts ? |
Thanks abhi for the analysis. Do you fancy putting together a pull request ;-) |
Sure. Let me try and look into this further |
Thanks that would be awesome. You will need to sign a CLA though see https://github.com/payara/Payara/blob/master/Contributing.md |
FISH-6269 FISH-6195 FISH-6240 FISH-6254 Upgrade tool 1.4
Bootstrapping Payara Micro, stopping it then boot strapping it again results in
The text was updated successfully, but these errors were encountered: