Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Reloading context hangs with tomcat
Reloading context hangs with tomcat [message #232735] Fri, 19 June 2009 15:32 Go to next message
Eclipse UserFriend
Originally posted by: elwood.agouros.de

Hi,

I am writing a servlet and have a tomcat 5.5 integrated as 'server' into
eclipse. For a while it was working quite fine, that when i saved the
servlet's source the context in tomcat would be reloaded. Now all that
happens is, that I get a message 'reloading started' on the console and
the server hangs in status restart but this never finishes. So i have to
manually stop and start.

Anybody got an idea, how to deal with this?

Konstantin
Re: Reloading context hangs with tomcat [message #232743 is a reply to message #232735] Fri, 19 June 2009 16:41 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Konstantin Agouros wrote:
> Hi,
>
> I am writing a servlet and have a tomcat 5.5 integrated as 'server' into
> eclipse. For a while it was working quite fine, that when i saved the
> servlet's source the context in tomcat would be reloaded. Now all that
> happens is, that I get a message 'reloading started' on the console and
> the server hangs in status restart but this never finishes. So i have to
> manually stop and start.
>
> Anybody got an idea, how to deal with this?
>
> Konstantin

When you change the servlet, the server's status changes to "Restart"
indicating that the server thinks you need to restart the server to pick
up the change. It doesn't imply that the Tomcat server is in the
process of automatically restarting. You have to do that manually by
executing "Start" while Tomcat is running, or executing "Stop" followed
by "Start".

The Tomcat support in WTP currently isn't able to track the context
reloading that happens internally in the running Tomcat. If the reload
happens successfully, you can ignore the "Restart" state on the server
for the time being. The reload should make your servlet changes
available. You should be aware that it's not unusual for the reloaded
webapp to leak memory. Thus, it's not unheard of that after a few
reloads, the server runs out of memory. A restart us needed when you
need to recover leaked memory.

I will also mention that you may want to avoid executing "Start" while
Tomcat is running as a means of restarting Tomcat. Executing "Stop"
followed by a "Start" is a safer approach. Tomcat will wait forever for
webapps to fully clean up. If a webapp doesn't cleanup completely,
especially with respect to stopping non-daemon threads it starts, Tomcat
will fail to shutdown. Clicking "Stop" has the advantage of providing a
timeout. If Tomcat fails to stop within the timeout, a dialog will
appear giving you the option to terminate the server or continue
waiting. Clicking "Start" while Tomcat is running doesn't support that
timeout. If Tomcat fails to stop, the server will be stuck in the
"Stopping..." state. You will have to terminate the server outside of
Eclipse, or exit Eclipse, which will terminate the server as a child
process of the Eclipse process.

Cheers,
Larry
Re: Reloading context hangs with tomcat [message #232751 is a reply to message #232743] Fri, 19 June 2009 17:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: elwood.agouros.de

Larry Isaacs wrote:
> Konstantin Agouros wrote:
>> Hi,
>>
>> I am writing a servlet and have a tomcat 5.5 integrated as 'server'
>> into eclipse. For a while it was working quite fine, that when i saved
>> the servlet's source the context in tomcat would be reloaded. Now all
>> that happens is, that I get a message 'reloading started' on the
>> console and the server hangs in status restart but this never
>> finishes. So i have to manually stop and start.
>>
>> Anybody got an idea, how to deal with this?
>>
>> Konstantin
>
> When you change the servlet, the server's status changes to "Restart"
> indicating that the server thinks you need to restart the server to pick
> up the change. It doesn't imply that the Tomcat server is in the
> process of automatically restarting. You have to do that manually by
> executing "Start" while Tomcat is running, or executing "Stop" followed
> by "Start".
>
> The Tomcat support in WTP currently isn't able to track the context
> reloading that happens internally in the running Tomcat. If the reload
> happens successfully, you can ignore the "Restart" state on the server
> for the time being. The reload should make your servlet changes
> available. You should be aware that it's not unusual for the reloaded
> webapp to leak memory. Thus, it's not unheard of that after a few
> reloads, the server runs out of memory. A restart us needed when you
> need to recover leaked memory.
>
> I will also mention that you may want to avoid executing "Start" while
> Tomcat is running as a means of restarting Tomcat. Executing "Stop"
> followed by a "Start" is a safer approach. Tomcat will wait forever for
> webapps to fully clean up. If a webapp doesn't cleanup completely,
> especially with respect to stopping non-daemon threads it starts, Tomcat
> will fail to shutdown. Clicking "Stop" has the advantage of providing a
> timeout. If Tomcat fails to stop within the timeout, a dialog will
> appear giving you the option to terminate the server or continue
> waiting. Clicking "Start" while Tomcat is running doesn't support that
> timeout. If Tomcat fails to stop, the server will be stuck in the
> "Stopping..." state. You will have to terminate the server outside of
> Eclipse, or exit Eclipse, which will terminate the server as a child
> process of the Eclipse process.
>
> Cheers,
> Larry
I think the cleanup part is the problem. I actually never tried pressing
'start' while it is running i always executed stop/start. Is there a way
to trace what it is doing after the 'reloading this context has started'
message appears? I wouldn't have asked if this hasn't been working earlier.

If You say that 'stop/start' is the way to go I'll leave it at that
though it would be a pity :)

Regards,

Konstantin
Re: Reloading context hangs with tomcat [message #232756 is a reply to message #232751] Fri, 19 June 2009 17:51 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Konstantin Agouros wrote:
> Larry Isaacs wrote:
>> Konstantin Agouros wrote:
>>> Hi,
>>>
>>> I am writing a servlet and have a tomcat 5.5 integrated as 'server'
>>> into eclipse. For a while it was working quite fine, that when i
>>> saved the servlet's source the context in tomcat would be reloaded.
>>> Now all that happens is, that I get a message 'reloading started' on
>>> the console and the server hangs in status restart but this never
>>> finishes. So i have to manually stop and start.
>>>
>>> Anybody got an idea, how to deal with this?
>>>
>>> Konstantin
>>
>> When you change the servlet, the server's status changes to "Restart"
>> indicating that the server thinks you need to restart the server to
>> pick up the change. It doesn't imply that the Tomcat server is in the
>> process of automatically restarting. You have to do that manually by
>> executing "Start" while Tomcat is running, or executing "Stop"
>> followed by "Start".
>>
>> The Tomcat support in WTP currently isn't able to track the context
>> reloading that happens internally in the running Tomcat. If the reload
>> happens successfully, you can ignore the "Restart" state on the server
>> for the time being. The reload should make your servlet changes
>> available. You should be aware that it's not unusual for the reloaded
>> webapp to leak memory. Thus, it's not unheard of that after a few
>> reloads, the server runs out of memory. A restart us needed when you
>> need to recover leaked memory.
>>
>> I will also mention that you may want to avoid executing "Start" while
>> Tomcat is running as a means of restarting Tomcat. Executing "Stop"
>> followed by a "Start" is a safer approach. Tomcat will wait forever
>> for webapps to fully clean up. If a webapp doesn't cleanup
>> completely, especially with respect to stopping non-daemon threads it
>> starts, Tomcat will fail to shutdown. Clicking "Stop" has the
>> advantage of providing a timeout. If Tomcat fails to stop within the
>> timeout, a dialog will appear giving you the option to terminate the
>> server or continue waiting. Clicking "Start" while Tomcat is running
>> doesn't support that timeout. If Tomcat fails to stop, the server
>> will be stuck in the "Stopping..." state. You will have to terminate
>> the server outside of Eclipse, or exit Eclipse, which will terminate
>> the server as a child process of the Eclipse process.
>>
>> Cheers,
>> Larry
> I think the cleanup part is the problem. I actually never tried pressing
> 'start' while it is running i always executed stop/start. Is there a way
> to trace what it is doing after the 'reloading this context has started'
> message appears? I wouldn't have asked if this hasn't been working earlier.
>
> If You say that 'stop/start' is the way to go I'll leave it at that
> though it would be a pity :)
>
> Regards,
>
> Konstantin

I guess I'm not clear on what you mean by "server hangs in status
restart". Seeing "Restart" in the Severs view doesn't indicate a hang.
What is happening now that seems to imply a hang that wasn't
happening before. Normally "reloading started" is all you are
guaranteed to see when an context reloads. Are you seeing something
more or some symptom that indicates a problem. Note, you can always run
the server in debug mode and see what threads are doing when you thing
the server is hung.

Cheers,
Larry
Re: Reloading context hangs with tomcat [message #232773 is a reply to message #232756] Sat, 20 June 2009 15:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: elwood.agouros.de

Larry Isaacs wrote:
> Konstantin Agouros wrote:
>> Larry Isaacs wrote:
>>> Konstantin Agouros wrote:
>>>> Hi,
>>>>
>>>> I am writing a servlet and have a tomcat 5.5 integrated as 'server'
>>>> into eclipse. For a while it was working quite fine, that when i
>>>> saved the servlet's source the context in tomcat would be reloaded.
>>>> Now all that happens is, that I get a message 'reloading started' on
>>>> the console and the server hangs in status restart but this never
>>>> finishes. So i have to manually stop and start.
>>>>
>>>> Anybody got an idea, how to deal with this?
>>>>
>>>> Konstantin
>>>
>>> When you change the servlet, the server's status changes to "Restart"
>>> indicating that the server thinks you need to restart the server to
>>> pick up the change. It doesn't imply that the Tomcat server is in
>>> the process of automatically restarting. You have to do that
>>> manually by executing "Start" while Tomcat is running, or executing
>>> "Stop" followed by "Start".
>>>
>>> The Tomcat support in WTP currently isn't able to track the context
>>> reloading that happens internally in the running Tomcat. If the
>>> reload happens successfully, you can ignore the "Restart" state on
>>> the server for the time being. The reload should make your servlet
>>> changes available. You should be aware that it's not unusual for the
>>> reloaded webapp to leak memory. Thus, it's not unheard of that after
>>> a few reloads, the server runs out of memory. A restart us needed
>>> when you need to recover leaked memory.
>>>
>>> I will also mention that you may want to avoid executing "Start"
>>> while Tomcat is running as a means of restarting Tomcat. Executing
>>> "Stop" followed by a "Start" is a safer approach. Tomcat will wait
>>> forever for webapps to fully clean up. If a webapp doesn't cleanup
>>> completely, especially with respect to stopping non-daemon threads it
>>> starts, Tomcat will fail to shutdown. Clicking "Stop" has the
>>> advantage of providing a timeout. If Tomcat fails to stop within the
>>> timeout, a dialog will appear giving you the option to terminate the
>>> server or continue waiting. Clicking "Start" while Tomcat is running
>>> doesn't support that timeout. If Tomcat fails to stop, the server
>>> will be stuck in the "Stopping..." state. You will have to terminate
>>> the server outside of Eclipse, or exit Eclipse, which will terminate
>>> the server as a child process of the Eclipse process.
>>>
>>> Cheers,
>>> Larry
>> I think the cleanup part is the problem. I actually never tried
>> pressing 'start' while it is running i always executed stop/start. Is
>> there a way to trace what it is doing after the 'reloading this
>> context has started' message appears? I wouldn't have asked if this
>> hasn't been working earlier.
>>
>> If You say that 'stop/start' is the way to go I'll leave it at that
>> though it would be a pity :)
>>
>> Regards,
>>
>> Konstantin
>
> I guess I'm not clear on what you mean by "server hangs in status
> restart". Seeing "Restart" in the Severs view doesn't indicate a hang.
> What is happening now that seems to imply a hang that wasn't
> happening before. Normally "reloading started" is all you are
> guaranteed to see when an context reloads. Are you seeing something
> more or some symptom that indicates a problem. Note, you can always run
> the server in debug mode and see what threads are doing when you thing
> the server is hung.
>
> Cheers,
> Larry
Ok I wasn't clear on the before situation:

I would see 'reloading of context succeeded' or a similar text with the
same meaning on the console and the status would be started/synchronized.

Now it just prints a message that it started reloading the context but
never finishes this. Is it possible that tomcat tries to save existing
sessions and this is not working?

Konstantin
Re: Reloading context hangs with tomcat [message #232790 is a reply to message #232773] Mon, 22 June 2009 13:14 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Konstantin Agouros wrote:
> Larry Isaacs wrote:
>> Konstantin Agouros wrote:
>>> Larry Isaacs wrote:
>>>> Konstantin Agouros wrote:
>>>>> Hi,
>>>>>
>>>>> I am writing a servlet and have a tomcat 5.5 integrated as 'server'
>>>>> into eclipse. For a while it was working quite fine, that when i
>>>>> saved the servlet's source the context in tomcat would be reloaded.
>>>>> Now all that happens is, that I get a message 'reloading started'
>>>>> on the console and the server hangs in status restart but this
>>>>> never finishes. So i have to manually stop and start.
>>>>>
>>>>> Anybody got an idea, how to deal with this?
>>>>>
>>>>> Konstantin
>>>>
>>>> When you change the servlet, the server's status changes to
>>>> "Restart" indicating that the server thinks you need to restart the
>>>> server to pick up the change. It doesn't imply that the Tomcat
>>>> server is in the process of automatically restarting. You have to
>>>> do that manually by executing "Start" while Tomcat is running, or
>>>> executing "Stop" followed by "Start".
>>>>
>>>> The Tomcat support in WTP currently isn't able to track the context
>>>> reloading that happens internally in the running Tomcat. If the
>>>> reload happens successfully, you can ignore the "Restart" state on
>>>> the server for the time being. The reload should make your servlet
>>>> changes available. You should be aware that it's not unusual for
>>>> the reloaded webapp to leak memory. Thus, it's not unheard of that
>>>> after a few reloads, the server runs out of memory. A restart us
>>>> needed when you need to recover leaked memory.
>>>>
>>>> I will also mention that you may want to avoid executing "Start"
>>>> while Tomcat is running as a means of restarting Tomcat. Executing
>>>> "Stop" followed by a "Start" is a safer approach. Tomcat will wait
>>>> forever for webapps to fully clean up. If a webapp doesn't cleanup
>>>> completely, especially with respect to stopping non-daemon threads
>>>> it starts, Tomcat will fail to shutdown. Clicking "Stop" has the
>>>> advantage of providing a timeout. If Tomcat fails to stop within
>>>> the timeout, a dialog will appear giving you the option to terminate
>>>> the server or continue waiting. Clicking "Start" while Tomcat is
>>>> running doesn't support that timeout. If Tomcat fails to stop, the
>>>> server will be stuck in the "Stopping..." state. You will have to
>>>> terminate the server outside of Eclipse, or exit Eclipse, which will
>>>> terminate the server as a child process of the Eclipse process.
>>>>
>>>> Cheers,
>>>> Larry
>>> I think the cleanup part is the problem. I actually never tried
>>> pressing 'start' while it is running i always executed stop/start. Is
>>> there a way to trace what it is doing after the 'reloading this
>>> context has started' message appears? I wouldn't have asked if this
>>> hasn't been working earlier.
>>>
>>> If You say that 'stop/start' is the way to go I'll leave it at that
>>> though it would be a pity :)
>>>
>>> Regards,
>>>
>>> Konstantin
>>
>> I guess I'm not clear on what you mean by "server hangs in status
>> restart". Seeing "Restart" in the Severs view doesn't indicate a
>> hang. What is happening now that seems to imply a hang that wasn't
>> happening before. Normally "reloading started" is all you are
>> guaranteed to see when an context reloads. Are you seeing something
>> more or some symptom that indicates a problem. Note, you can always
>> run the server in debug mode and see what threads are doing when you
>> thing the server is hung.
>>
>> Cheers,
>> Larry
> Ok I wasn't clear on the before situation:
>
> I would see 'reloading of context succeeded' or a similar text with the
> same meaning on the console and the status would be started/synchronized.
>
> Now it just prints a message that it started reloading the context but
> never finishes this. Is it possible that tomcat tries to save existing
> sessions and this is not working?
>
> Konstantin

Searching Tomcat source, I can find the LocalStrings.properties where
"reloadingStarted" and "reloadingCompleted" are defined. I can also
search the source and find where "reloadingStarted" is used. However,
when I search the source for "reloadingCompleted", I don't find it used
anywhere. This applies to the 5.5.20, 5.5.26, 5.5.27, and 6.1.18 Tomcat
sources I searched. It would appear normal for recent Tomcat 5.5.x and
Tomcat 6.1.x not to display "Reloading this Context is completed". I
don't know which version of Tomcat last displayed that string. Are
there other symptoms that suggests the reloading is not successful?

Cheers,
Larry
Previous Topic:Can I extend Tomcat and JBoss Launch Configurations?
Next Topic:Xml SourceViewer
Goto Forum:
  


Current Time: Thu Apr 25 10:22:50 GMT 2024

Powered by FUDForum. Page generated in 0.03894 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top