Bug 59027

Summary: Tomcat Virtual Host Manager application doesn't persist newly created virtual hosts
Product: Tomcat 8 Reporter: Coty Sutherland <csutherl>
Component: ManagerAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: pskopek, wesley.acheson
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: All   
OS: All   
Attachments: Rough patch proposal

Description Coty Sutherland 2016-02-18 15:07:04 UTC
Created attachment 33569 [details]
Rough patch proposal

+++ This bug was initially created as a clone of Bug #48674 +++

If one create virtual host using /host-manager application all work as
expected. Start/Stop/Remove actions.
But newly created host is not persistently added to the Tomcat configuration.
After restart of Tomcat there is only localhost host listed.
Comment 1 Mark Thomas 2016-02-18 15:12:19 UTC

*** This bug has been marked as a duplicate of bug 48674 ***
Comment 2 Coty Sutherland 2016-02-18 15:14:51 UTC
This enhancement was brought to my attention and seemed like a relatively easy thing to add, so I gave it a shot. Instead of using the patch from the original bug I re-implemented the request using StoreConfig. This makes the changes a lot smaller and prevented functional duplication of code that already existed in StoreConfig. Note that this patch isn't 100% complete; I'm looking for some feedback on how I can resolve a couple of things before I would consider it complete.

My original thought was to add a button next to each host that would be available to persist the host's configuration, however I think the StoreConfig interface Impl needs some changes to make that happen, so I'm just using storeConfig to save the complete configuration. I left the button on the host row because I couldn't figure out where else to put it (feedback please). Maybe it should be a link at the top? I also just noticed when I was doing some testing that there is no way to remove a host and persist that, so that furthers the idea that the button should be somewhere else on the page.

If StoreConfig isn't enabled when you click the persist button it will provide a failure message that suggests enabling it by catching the InstanceNotFound exception.