geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashish Jain <>
Subject Difference in start/stop and restart behavior
Date Wed, 12 Aug 2009 10:08:04 GMT

Recently I have seen difference in the functionality of stop/start and
restart options available against each module. In case of stop/start I see
old classloaders
being discarded and new ones being created. In case of restart same old
classloaders are used.

I am attaching a sample DummyProject here and an explanation of how it works

It has three classes: TestServlet , TestService and TestBean

1. Request comes to the TestServlet => Console prints “In TestServlet”
2. TestServlet makes a call to the TestService class. TestService class has
a static variable called testBean of type TestBean. This variable is an
initialized during class loading.
4. When the call comes to TestService, if the static variable is created
then the Console prints “In TestBean constructor”. In case the static
variables isn't created then this statement doesn’t get printed to the
5. After which console prints “In TestService class”

Steps to run the application:
1.    Deploy this application to WAS community edition
2.    Start the application
3.    Hit the <WAS url>/<context>/TestServlet
4.    Check the console

If static variables are created then all the three statements must appear as
below in the console:
=> In TestServlet
=> In TestBean constructor
=> In TestService class

Restart the application and follow steps 2, 3 and 4. Notice only first and
last statements ('In TestServlet' & ' In TestService class') appear
indicating that static variables aren't created. But when stop and the start
this application, all the 3 statements appear.

I would  like to know if this difference is intended or does it require some
fix so that restart behaves in a similar manner as stop/start?


View raw message