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 40128 - IDE removes custom configuration of context.xml
Summary: IDE removes custom configuration of context.xml
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker with 1 vote (vote)
Assignee: Pavel Buzek
URL:
Keywords:
: 37763 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-16 09:51 UTC by Milan Kuchtiak
Modified: 2004-02-18 21:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kuchtiak 2004-02-16 09:51:36 UTC
Not only the context.xml is not customizable from
IDE (issue 39220) but IDE removes the
configuration that has been set up manually.

I would set the priority to P1, but this is the
data lost of data created outside the IDE.

The issue is rather serious since there are
several  cases where context.xml configuration is
recommended from Jakarta-Tomcat :

- Data source configuration
- Logger configuration

The worst in this issue is the fact that either
changes in web_module/META-INF/context.xml or
changes in
CATALINA_BASE/conf/Catalina/localhost/web_module.xml
are lost during the deployment.
Comment 1 vanob 2004-02-17 10:08:26 UTC
This is really annoyng.

I don't use internal tomcat.
I have Ant target that packages everything in war file
and puts to the tomcat appbase/webapps

If the ide does not provide usable property editor for the context.xml
it must allow to open this file in xml editor.
Comment 2 Pavel Buzek 2004-02-18 01:25:18 UTC
Correct me if I am wrong: the problem here is that the external
changes to the context.xml file get overwritten:
- when you save the file in IDE or 
- when it gets saved automatically during development or
- when you do not have the path set and the IDE sets if when you open
the module
This is the behavior for 3.6 (see 39220).

My testing shows that if I create a module externally and put
something into context.xml and then open it in IDE it preserves the
values. If I edit the file externally the IDE does not reload it (but
does not overwrite my changes either) and I will check if I can fix that.

The rest of comments is duplicate of 39220.
Let me know if I am missing something.

Comment 3 Pavel Buzek 2004-02-18 05:56:29 UTC
IDE will now reload the configuration when it is changed externally
(assuming the change will be reported via Filesystems API).

I will wait for more explanation before I close this issue as fixed.
Comment 4 Milan Kuchtiak 2004-02-18 15:46:34 UTC
May be I was not correct claiming that deployment removes the custom
configuration in context.xml - it preserves it.

Only the modification (either in editor or in Context Path property)
destroys everything except the path attribute.

The problem is that the configuration file used for web module in
servlet container is :
CATALINA_BASE/conf/Catalina/localhost/web_module.xml.

Example :

My context.xml in META-INF :
====================================================
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/test5">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="my_log." suffix=".txt" timestamp="true"/>
</Context>
====================================================
The resulted test5.xml in CATALINA_BASE/conf/Catalina/localhost
=============================================
<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/E:/test5/" path="/test5">
</Context>
=============================================

The second file is crucial for web module in runtime.

I noticed that you can modify the
CATALINA_BASE/conf/Catalina/localhost/test5.xml manually.
Then the Tomcat restart preserves the configuration(test5.xml) as well.

If user wants to use some specific <Context> configuration, this rules
need to be followed currently :

1. The web module (wm) must be started first.
2. Custom configuration of <Context> element need to be setup in
CATALINA_BASE/conf/Catalina/localhost/wm.xml
3. wm/META-INF/context.xml musn't be edited (in IDE)
4. Context Path property (of WEB-INF) musn't be changed

I think we can't require user to follow that.
Comment 5 Pavel Buzek 2004-02-18 17:54:39 UTC
*** Issue 37763 has been marked as a duplicate of this issue. ***
Comment 6 Pavel Buzek 2004-02-18 21:52:29 UTC
I think the problem is fixed. Everything from context.xml now appears
in conf/Catalina/localhost/${path}.xml file.