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.
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.
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.
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.
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.
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.
*** Issue 37763 has been marked as a duplicate of this issue. ***
I think the problem is fixed. Everything from context.xml now appears in conf/Catalina/localhost/${path}.xml file.