https://issues.apache.org/bugzilla/show_bug.cgi?id=44856
Summary: add host alias using jmx doesn't take affect until
restart
Product: Tomcat 5
Version: Unknown
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Connector:AJP
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Depends on: 42707
Part of the problem is that Mapper.java will not properly update aliases for a
Host that already exists. Potential fix in Mapper.java: (Note -- code
originally posted by Luke Kirby, inelegantly re-written)
public synchronized void addHost(String name, String[] aliases,
Object host) {
Host[] newHosts = new Host[hosts.length + 1];
Host newHost = new Host();
ContextList contextList = new ContextList();
newHost.name = name;
newHost.contextList = contextList;
newHost.object = host;
if (insertMap(hosts, newHosts, newHost)) {
hosts = newHosts;
for (int i = 0; i < aliases.length; i++) {
newHosts = new Host[hosts.length + 1];
newHost = new Host();
newHost.name = aliases[i];
newHost.contextList = contextList;
newHost.object = host;
if (insertMap(hosts, newHosts, newHost)) {
hosts = newHosts;
}
}
}
else {
Host aliasedHost;
// insert failed because the host already exists; grab it
int hostPos = find(hosts, name);
if (hostPos >= 0) {
aliasedHost = hosts[hostPos];
for (int i = 0; i < aliases.length; i++) {
newHosts = new Host[hosts.length + 1];
newHost = new Host();
newHost.name = aliases[i];
newHost.contextList = aliasedHost.contextList;
newHost.object = aliasedHost.object;
if (insertMap(hosts, newHosts, newHost)) {
hosts = newHosts;
}
}
} else {
// I can't imagine why this would happen..
System.out.println("huh?");
}
}
}
--
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]