https://issues.apache.org/bugzilla/show_bug.cgi?id=45764
Summary: Embedded fails to configure hosts with HostConfig
Product: Tomcat 6
Version: 6.0.18
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: minor
Priority: P2
Component: Catalina
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
I admit that I am new to Tomcat, but the following seems like a bug.
When attempting to launch Tomcat embedded, hosts (specifically StandardHosts)
created are not configured with a HostConfig. Consequently, all deployment
flags for WAR deployment like autoDeploy and deployOnStartup are ignored. I
recommend adding the following to the implementation of createHost(..) in the
Embedded class:
public Host createHost(String name, String appBase) {
... // logging code
StandardHost host = new StandardHost();
host.setAppBase(appBase);
host.setName(name);
+// Host config should listen for lifecycle changes in host (notably the
start event)
+HostConfig deployer = new HostConfig();
+host.addLifecycleListener(deployer);
return (host);
}
The implementation of createContext() is similarly designed to use the
ContextConfig, so I assume this was omitted on accident. Otherwise, those
wanting the auto deployment capabilities when running embedded must override
the createHost() method or create a HostConfig listener manually. This change
seems well in line with the API documentation, which details that this function
should "Create, configure, and return a Host...".
If however, this was purposefully omitted, please let me know why.
Thanks,
Mike Huffman
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]