This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 40526 - The webmodule should be redeployed when user changes the context.xml
Summary: The webmodule should be redeployed when user changes the context.xml
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Sherold Dev
Keywords: RELNOTE
: 41948 46141 (view as bug list)
Depends on: 42065
  Show dependency tree
Reported: 2004-02-26 15:17 UTC by Marek Fukala
Modified: 2004-08-13 12:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

commit log (4.26 KB, text/plain)
2004-04-17 07:34 UTC, Pavel Buzek

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Fukala 2004-02-26 15:17:39 UTC
Current state is that the webmodule is redeployed
(changes in the context.xml are taken into account
only when the path attribute is changed).
When user changes the context.xml in a different
way e.g. adds a new valve into, the changes are
not propagated when the webmodule is executed. The
user has to manually undeploy the webmodule and
then use the execute action.
Comment 1 Pavel Buzek 2004-02-26 18:37:51 UTC
j2eeserver takes care of detecting changes and deciding is the module
needs to be reloaded, it needs to take server specific config files in
consideration in addition to standard DD.
Comment 2 Nam Nguyen 2004-02-26 18:49:37 UTC
I think that the stop/start/reload/restartserver/... are
responsibility of plugin when incrementalDeploy is call.  The exact
sequences for each situation could be differenet for different
platform.  If j2eeserver assume a step, it could confuse the complete
sequence, so it assume nothing.  Plugin has to base on TMID and change
descriptors passed in the call to react properly.
Comment 3 Nam Nguyen 2004-02-27 08:22:34 UTC
Retarget to promo D for further evaluation.
Comment 4 Milan Kuchtiak 2004-02-27 14:47:48 UTC
I think, the tremendous effort to fix the issue 39220 was useless when
changes in context.xml won't affect the deployment.

Comment 5 Marek Fukala 2004-02-27 15:03:06 UTC
This issue seems to me (and all people I have talked about it) worth
fixing in promo-B. As Milan pointed out the context.xml editing
feature is degradated by the fact that the changes aren't taken into
account during webmodule execution.
This issue needs at least further evaluation of the team. 
Comment 6 Nam Nguyen 2004-02-27 15:57:59 UTC
OK, so it should be P2 and we will evaluate and resolve this issue
now.  I added Ludo for comments.

I believe we should undeploy or restart or reload (whatever needed)
only in the plugin.  Change of "root context" is a special case that
requires a undeploy (for web modules only).  I don't think we want
wholesome action like that for any configuration descriptor changes
for every platform.  It would be costly for large applications.  So
only restart or reload or whatever minimal should be done at the
discretion of the plugins.
Comment 7 Petr Jiricka 2004-02-27 16:48:04 UTC
I agree this should be fixed on the side of the plugin. In particular,
in TomcatIncrementalDeployment.incrementalDeploy(...), this method
needs to determine whether to call restart() or reload() on
TomcatManagerImpl. In this case, restart() should be called. (That's
my guess, at least.)

Changing target milestone to TBD, so we don't forget to
reevaluate/reconsider this. Assigning to Pavel.
Comment 8 Marek Fukala 2004-03-02 06:39:05 UTC
We agreed this is a high priority bug -> raising to P2
Comment 9 Marek Fukala 2004-03-02 06:39:16 UTC
We agreed this is a high priority bug -> raising to P2
Comment 10 Pavel Buzek 2004-03-02 23:40:13 UTC
the problem is actually in tomcat implementation, sorry for confusion

fixed in release36
Comment 11 Marek Fukala 2004-03-15 14:30:00 UTC
Comment 12 Marek Fukala 2004-04-07 09:21:34 UTC
I have just tried to check the described functionality and I
surprisingly realized that it doesn't work. 
If I try to follow this scenario, the context.xml in
$CB/conf/Catalina/host directory is not updated and the changes are
not taken into account by the tomcat server.
1) create a webmodule & execute it
2) change $WMHOME/META-INF/context.xml (for example add
reloadable="true" attribute to the Context element
3) execute the webmodule 

Pavel Buzek has already -fixed- this in release36 branch on 04/03/02,
see the diff:

I trully do not understand why I marked the bug as verified even if
this do not work - maybe there are some unknown circumstances??? I do
not know. I tried to check it also in older builds (20040304,
20040310) and it doesn't work as well.

I am really disappointed by this especially because of I pushed this
issue to be fixed. Because of my fault the users will have to live
with this :-(((. 

I suggest to waive it now.
Comment 13 Pavel Buzek 2004-04-07 18:37:58 UTC
I do not see how to fix this so I am asking for a waiver.

Tomcat currectly does either start/stop (for web.xml or context.xml)
or reload (for classes changed) but for context.xml this is not enough. 
Maybe we will need to actually undeploy and deploy again. That is not
supported by incremental deployment APIs. I will investigate more and
try to fix in trunk.
Comment 14 Patrick Keegan 2004-04-08 00:22:53 UTC
I just noticed this one because it was waived. Stealing from Pavel's
waiver text for possible relnote text:

Description: When you change the context.xml file and execute the
module again, the module is not redeployed with the the changes that
were made  in context.xml.

Workaround: Undeploy the module from Server registry in Runtime tab
and then execute the module.
Comment 15 Jan Chalupa 2004-04-09 17:41:22 UTC
Waiver approved for 3.6.
Comment 16 _ proxity 2004-04-14 13:06:21 UTC
Looking at
shows me that you should really fix that.

Deploying on a running Tomcat server

    If the host "autoDeploy" property is true, the host will attempt
to deploy and update web applications dynamically, as needed. The host
will need to have background processing enabled for automatic
reloading to work, which is the default.

    This includes:
        * Redeployment of the web application if the /WEB-INF/web.xml
file is updated.
        * Redeployment of the web application if the context XML file
from which the web application has been deployed is updated.
        * Redeployment of the web application if a context XML file
(with a name corresponding to the context path of the previously
deployed application) is added in the
$CATALINA_HOME/conf/[enginename]/[hostname]/ folder.

    Note: Web application reloading can also be configured in the
loader, in which case loaded classes will be tracked for changes.
Comment 17 _ proxity 2004-04-15 13:56:22 UTC
Please check bug #41948.
To me it seems that there's something totally wrong with the context file.
Comment 18 Pavel Buzek 2004-04-16 05:49:21 UTC
*** Issue 41948 has been marked as a duplicate of this issue. ***
Comment 19 Pavel Buzek 2004-04-16 05:53:42 UTC
I tested with the example that Boris provided in 41948 (thanks!) and
the problem is that a change in context.xml required the module to be
undeployed and deployed again. One workaround was mentioned here,
another workaround is to change context path (I think doing undeploy
from Runtime tab is easier though).

The solution will require a change in j2eeserver API. I will
communicate this with developers of other server plugins and make the
change and then get back and fix this issue.
Comment 20 _ proxity 2004-04-16 12:35:33 UTC
I described your workaround and a possible solution in bug #41948.
Comment 21 Pavel Buzek 2004-04-17 07:34:13 UTC
fixed in trunk
Comment 22 Pavel Buzek 2004-04-17 07:34:57 UTC
Created attachment 14440 [details]
commit log
Comment 23 Marek Fukala 2004-07-14 14:19:48 UTC
*** Issue 46141 has been marked as a duplicate of this issue. ***
Comment 24 Marek Fukala 2004-07-14 14:21:34 UTC
The problem with not-redeployed context.xml is not fixed in Promo-D.
Please reevaluate.
Comment 25 Marek Fukala 2004-07-14 14:25:00 UTC
little specification: the webmodule is not redeployed when you change
the context.xml metadescriptor file. The change is detected and the wm
redeployed only when you modify the contextpath attribute.
Comment 26 Petr Jiricka 2004-07-29 13:56:44 UTC
Stepane, could you please look at this? Thanks.
Comment 27 Sherold Dev 2004-07-30 13:06:40 UTC
Commit log:

Checking in;
new revision: 1.4; previous revision: 1.3
Comment 28 Petr Blaha 2004-08-04 16:14:30 UTC
Build 20040802