Index: core/kernel/src/main/java/com/sun/enterprise/v3/admin/adapter/AdminEndpointDecider.java =================================================================== --- core/kernel/src/main/java/com/sun/enterprise/v3/admin/adapter/AdminEndpointDecider.java (revision 61562) +++ core/kernel/src/main/java/com/sun/enterprise/v3/admin/adapter/AdminEndpointDecider.java (working copy) @@ -43,6 +43,7 @@ import com.sun.enterprise.config.serverbeans.AdminService; import com.sun.enterprise.config.serverbeans.Config; import com.sun.enterprise.config.serverbeans.ServerTags; +import com.sun.enterprise.config.serverbeans.VirtualServer; import com.sun.enterprise.v3.admin.AdminAdapter; import org.glassfish.grizzly.config.dom.NetworkListener; import org.glassfish.grizzly.config.dom.ThreadPool; @@ -51,10 +52,13 @@ import java.net.InetAddress; import java.net.UnknownHostException; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.logging.Logger; +import org.glassfish.hk2.api.ServiceLocator; +import org.glassfish.internal.api.Globals; /** Makes various decisions about the admin adapters. * @@ -123,8 +127,18 @@ } catch (NumberFormatException ne) { } } + ServiceLocator sl = Globals.getDefaultBaseServiceLocator(); String dvs = nl.findHttpProtocol().getHttp().getDefaultVirtualServer(); - guiHosts = Collections.unmodifiableList(Arrays.asList(dvs)); +// guiHosts = Collections.unmodifiableList(Arrays.asList(dvs)); + VirtualServer vs = sl.getService(VirtualServer.class, dvs); + String vsHosts = vs.getHosts(); + if (!vsHosts.isEmpty()) { + final List hostList = new ArrayList(); + hostList.addAll(Arrays.asList(vsHosts.split(","))); + guiHosts = Collections.unmodifiableList(hostList); + } else { + guiHosts = Collections.unmodifiableList(Arrays.asList(dvs)); + } asadminHosts = guiHosts; //same for now try { address = InetAddress.getByName(nl.getAddress()); Index: common/internal-api/src/main/java/org/glassfish/internal/grizzly/V3Mapper.java =================================================================== --- common/internal-api/src/main/java/org/glassfish/internal/grizzly/V3Mapper.java (revision 61562) +++ common/internal-api/src/main/java/org/glassfish/internal/grizzly/V3Mapper.java (working copy) @@ -79,8 +79,8 @@ Object wrapper, boolean jspWildCard) { super.addWrapper(hostName, contextPath, path, wrapper, jspWildCard); if (logger.isLoggable(Level.FINE)) { - logger.fine("Wrapper-Host: " + hostName + " contextPath " + contextPath - + " wrapper " + wrapper + " path " + path + " jspWildcard " + jspWildCard); + logger.log(Level.FINE, "Wrapper-Host: {0} contextPath {1} wrapper {2} path {3} jspWildcard {4}", + new Object[]{hostName, contextPath, wrapper, path, jspWildCard}); } } @@ -93,8 +93,8 @@ // Prevent any admin related artifacts from being registered on a // non-admin listener, and vice versa - if (ADMIN_LISTENER.equals(getId()) && !ADMIN_VS.equals(name) || - !ADMIN_LISTENER.equals(getId()) && ADMIN_VS.equals(name)) { + if (ADMIN_LISTENER.equals(getId()) && !ADMIN_VS.equals(getDefaultHostName()) || + !ADMIN_LISTENER.equals(getId()) && ADMIN_VS.equals(getDefaultHostName())) { return; } @@ -110,14 +110,14 @@ String[] welcomeResources, javax.naming.Context resources) { if (logger.isLoggable(Level.FINE)) { - logger.fine("Context-Host: " + hostName + " path " + path + " context " + context + - " port " + getPort()); + logger.log(Level.FINE, "Context-Host: {0} path {1} context {2} port {3}", + new Object[]{hostName, path, context, getPort()}); } // Prevent any admin related artifacts from being registered on a // non-admin listener, and vice versa - if (ADMIN_LISTENER.equals(getId()) && !ADMIN_VS.equals(hostName) || - !ADMIN_LISTENER.equals(getId()) && ADMIN_VS.equals(hostName)) { + if (ADMIN_LISTENER.equals(getId()) && !ADMIN_VS.equals(getDefaultHostName()) || + !ADMIN_LISTENER.equals(getId()) && ADMIN_VS.equals(getDefaultHostName())) { return; }