The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: Restarting Glassfish

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 8 - Last Post: Sep 23, 2007 4:37 PM by: kumara
Piero Filippin
Restarting Glassfish
Posted: Sep 21, 2007 5:02 AM
  Click to reply to this thread Reply

Hi,
I have a quick question: I have a remote installation of GF, I have full
access to the admin web interface, but I don't see any way to restart
glassfish!

I want to upload some libs (specifically - the mysql jdbc jar) to the
domain1/lib/ext folder, is there any way without console access (ie-just
restarting a domain, not the entire server)?

Also, when I modify some of the settings I get a "Glassfish restart is
required", which could be problematic as my server is 20 miles away from
my office!

What about adding a "restart glassfish" option in addition to "stop
instance"?

Piero

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


kslater

Posts: 4
Re: Restarting Glassfish
Posted: Sep 21, 2007 10:16 AM   in response to: Piero Filippin
  Click to reply to this thread Reply

I noticed the same thing on a box in my DMZ where I installed GF. I made a change and had to restart (per the admin console's alert) and managed to stop the server. I was able to ssh in and restart it, but it would be nice if that wasn't necessary.

Jason Lee
Re: Restarting Glassfish
Posted: Sep 21, 2007 10:21 AM   in response to: Piero Filippin
  Click to reply to this thread Reply

On 9/21/07, Piero Filippin <filippinp@yahoo.co.uk> wrote:
>
> Also, when I modify some of the settings I get a "Glassfish restart is
> required", which could be problematic as my server is 20 miles away from
> my office!
>
> What about adding a "restart glassfish" option in addition to "stop
> instance"?
>

I have asked the same thing in the past. I have now filed an issue on it:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=3677

For the record, the admin GUI team were aware of it and have been talking
about it, but no RFE has ever been filed to formalize the request, a lack I
have now fixed. :)

--
Jason Lee, SCJP
Software Architect -- Objectstream, Inc.
JSF RI Dev Team
http://blogs.steeplesoft.com
[att1.html]


whartung

Posts: 634
Re: Restarting Glassfish
Posted: Sep 21, 2007 11:59 AM   in response to: Jason Lee
  Click to reply to this thread Reply

Can this be done with a "cluster of one"?

Using the node agents? Or do they not have a GUI? I've not used the clustering software, but if you can start/restart a cluster from the GUI, then why not have a cluster with a single instance and let the node agent start it up?

Piero Filippin
Re: Restarting Glassfish
Posted: Sep 21, 2007 2:50 PM   in response to: whartung
  Click to reply to this thread Reply

I was wondering if there is any particular reason for the restart option
being missing - it would be nice i could restart GF just clicking on the
"restart required" message

In the meantime, I solved the problem with the verbose option and
putting the asadmin inside a bat file with a loop - when I bring down GF
from the web interface, another instance is immediately started .


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


whartung

Posts: 634
Re: Restarting Glassfish
Posted: Sep 21, 2007 4:57 PM   in response to: Piero Filippin
  Click to reply to this thread Reply

> I was wondering if there is any particular reason for
> the restart option
> being missing - it would be nice i could restart GF
> just clicking on the
> "restart required" message

Well, the reason this doesn't work for a standard server deployment is that there's nothing there to restart the server. There's no "easy" mechanism that the server has to restart itself as a single process.

What you discovered is that you could use the batch file in a loop as this agent for restarting the server.

There are other options along this line.

I assume (though do not know how) that you run GF as a Windows service, and I guess that a Windows service can restart if the service "fails", so that could be one mechanism.

If you were on Solaris, and configure Glassfish using the SMF, then it could also be configured to restart the process when it fails.

km

Posts: 681
Re: Restarting Glassfish
Posted: Sep 22, 2007 11:11 PM   in response to: whartung
  Click to reply to this thread Reply

Will,

This has been a long-standing request and though this is a rather intricate issue of restarting a
process from within itself.

The approach of "Platform Specific Service Mechanism" like SMF/Windows-Services may not help us here, because this is actually a legitimate shutdown followed by a start operation. There is
a possibility of exiting with a specific exit code and then rely on operating system to bring the
process back up.

Another problem is that users don't always like creating an operating system service for GlassFish server process.

A watchdog can be thought of as an option, but that increases the number of processes to 2 and
that too is not well accepted by most.

This needs some careful thought ...

- Kedar

Piero Filippin
Re: Restarting Glassfish
Posted: Sep 23, 2007 2:58 PM   in response to: km
  Click to reply to this thread Reply

I think there are two separate issues:

1) Restarting GF in the event GF itself crashes - this needs something
external, I think any SO provides a mechanism

2) Trigger a restart in GF when settings are changed - what about GF
creating a process at shutdown time, and having this process to launch
another GF instance when the first one is gone, and then killing
itself (I am not sure this can be done inside the same JVM)

- or even better -

What about avoiding GF having to be restarted when some of the settings
change? Do we really need to restart GF to change the port it is
listening to for example or to change the classpath?
I know that implementing things like that is not trivial, they add
complexity without any real benefit, but I think they should be taken
into account (maybe the next version?)

Piero

glassfish@javadesktop.org wrote:
> Will,
>
> This has been a long-standing request and though this is a rather intricate issue of restarting a
> process from within itself.
>
> The approach of "Platform Specific Service Mechanism" like SMF/Windows-Services may not help us here, because this is actually a legitimate shutdown followed by a start operation. There is
> a possibility of exiting with a specific exit code and then rely on operating system to bring the
> process back up.
>
> Another problem is that users don't always like creating an operating system service for GlassFish server process.
>
> A watchdog can be thought of as an option, but that increases the number of processes to 2 and
> that too is not well accepted by most.
>
> This needs some careful thought ...
>
> - Kedar
> [Message sent by forum member 'km' (km)]
>
> http://forums.java.net/jive/thread.jspa?messageID=236638
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net


kumara

Posts: 17
Re: Restarting Glassfish
Posted: Sep 23, 2007 4:37 PM   in response to: Piero Filippin
  Click to reply to this thread Reply

> 2) Trigger a restart in GF when settings are changed
> - what about GF
> creating a process at shutdown time, and having this
> process to launch
> another GF instance when the first one is gone, and
> then killing
> itself (I am not sure this can be done inside the
> same JVM)

Unfortunately this approach does not work easily. When you create a child process, it inherits all file descriptors from the parent and that would mean that newly created process would hold all ports and files from glassfish open. The process will then have enumerate through all file handles and close them one by one before trying to restart the glassfish process (to avoid running into "Port already in use" error). This can easily be done by going into OS native mode but if you compare the complexity with leaving a light weight parent shell running all the time, I think my pick will be obvious.

>
> - or even better -
>
> What about avoiding GF having to be restarted when
> some of the settings
> change? Do we really need to restart GF to change the
> port it is
> listening to for example or to change the classpath?
> I know that implementing things like that is not
> trivial, they add
> complexity without any real benefit, but I think they
> should be taken
> into account (maybe the next version?)
>

In general, that is the principle behind dynamic reconfiguration (change configuration without restarting) in glassfish. The intent is to make almost everything dynamically reconfigurable over time. If you have specific requirements on what would you like fixed first, please file an enhancement request.

There are some changes that can never be applied without restarting the VM (for example, changing VM memory settings, changing system classpath or changing system properties that affect loaded classes) but I think those changes are less frequent than changing configuration for http protocol.




 XML java.net RSS