users@glassfish.java.net

Re: Problems with listeners, hosts and multihoming

From: <glassfish_at_javadesktop.org>
Date: Fri, 04 Jul 2008 03:27:54 PDT

Hello
First, I usually work with Visual Web projects, but to simplify tests I had built A31, A32 and A33 as simpler JSP applications. The behaviour of those applications was strange, so I've built three new VW applications named V31, V32 and V33, and they behave as expected, except in host-header based routing.

Current behaviour is:
- browsing to http://lvov1.ips:8173 shows the docroot page; also with lvov2 and lvov3
- browsing to http://lvov1.ips:8273/V31 shows application V31; /V32 takes to app V32 and so; and also happens with lvov2 and lvov3.

It seems as if all the applications are available to all virtual servers and routing is not working or routing always to virtual server [b]server.[/b]

Due to that strange behaviour of jsp applications, I've been doing tests with the virtual server list in the web application properties page. The only difference is the attribute [b]virtual-servers[/b] in the [b]application-ref[/b] element. As test, I selected virtual server S31 for module V31, instead of the blank entry. The beahaviour didn't change at all. Module V31 was still available to any host name: lvov1.ips, lvov2.ips, lvov3.ips and even localhost. So I don't understand the uses of the virtual servers list in the web application properties page.

Back to what you have asked for. This are the domain.xml entries:
<web-module availability-enabled="false" context-root="/V31" directory-deployed="true" enabled="true" location="/home/aperez/NetBeansProjects/V31/build/web" name="V31" object-type="user"/>
    <web-module availability-enabled="false" context-root="/V32" directory-deployed="true" enabled="true" location="/home/aperez/NetBeansProjects/V32/build/web" name="V32" object-type="user"/>
    <web-module availability-enabled="false" context-root="/V33" directory-deployed="true" enabled="true" location="/home/aperez/NetBeansProjects/V33/build/web" name="V33" object-type="user"/>
<application-ref disable-timeout-in-minutes="30" enabled="true" lb-enabled="false" ref="V31"/>
<application-ref disable-timeout-in-minutes="30" enabled="true" lb-enabled="false" ref="V32"/>
<application-ref disable-timeout-in-minutes="30" enabled="true" lb-enabled="false" ref="V33"/>

the full http-service section
      <http-service>
        <access-log format="%client.name% %auth-user-name% %datetime% %request% %status% %response.length%" rotation-enabled="true" rotation-interval-in-minutes="15" rotation-policy="time" rotation-suffix="yyyy-MM-dd"/>
        <http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-1" port="8173" security-enabled="false" server-name="" xpowered-by="true">
          <property name="proxiedProtocols" value="ws/tcp"/>
        </http-listener>
        <http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="server" enabled="true" family="inet" id="http-listener-2" port="8274" security-enabled="true" server-name="" xpowered-by="true">
          <ssl cert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/>
        </http-listener>
        <http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false" default-virtual-server="__asadmin" enabled="true" family="inet" id="admin-listener" port="4941" security-enabled="false" server-name="" xpowered-by="true"/>
        <http-listener acceptor-threads="1" address="10.129.128.31" blocking-enabled="false" default-virtual-server="S31" enabled="false" family="inet" id="http-listener-31" port="8170" security-enabled="false" server-name="" xpowered-by="true"/>
        <http-listener acceptor-threads="1" address="10.129.128.32" blocking-enabled="false" default-virtual-server="S32" enabled="false" family="inet" id="http-listener-32" port="8171" security-enabled="false" server-name="" xpowered-by="true"/>
        <http-listener acceptor-threads="1" address="10.129.128.33" blocking-enabled="false" default-virtual-server="S33" enabled="false" family="inet" id="http-listener-33" port="8172" security-enabled="false" server-name="" xpowered-by="true"/>
        <virtual-server hosts="localhost, localhost.localdomain" http-listeners="http-listener-1,http-listener-2" id="server" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
          <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
          <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
          <property name="sso-enabled" value="false"/>
        </virtual-server>
        <virtual-server hosts="${com.sun.aas.hostName}" http-listeners="admin-listener" id="__asadmin" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
          <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
          <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
          <property name="sso-enabled" value="false"/>
        </virtual-server>
        <virtual-server default-web-module="V31" hosts="lvov1.ips" http-listeners="http-listener-1,http-listener-2" id="S31" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
          <property name="sso-enabled" value="false"/>
          <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
          <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
        </virtual-server>
        <virtual-server default-web-module="V32" hosts="lvov2.ips" http-listeners="http-listener-1,http-listener-2" id="S32" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
          <property name="sso-enabled" value="false"/>
          <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
          <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
        </virtual-server>
        <virtual-server default-web-module="V33" hosts="lvov3.ips" http-listeners="http-listener-1,http-listener-2" id="S33" log-file="${com.sun.aas.instanceRoot}/logs/server.log" state="on">
          <property name="sso-enabled" value="false"/>
          <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
          <property name="accesslog" value="${com.sun.aas.instanceRoot}/logs/access"/>
        </virtual-server>
        <request-processing header-buffer-length-in-bytes="8192" initial-thread-count="2" request-timeout-in-seconds="30" thread-count="5" thread-increment="1"/>
        <keep-alive max-connections="250" thread-count="1" timeout-in-seconds="30"/>
        <connection-pool max-pending-count="4096" queue-size-in-bytes="4096" receive-buffer-size-in-bytes="4096" send-buffer-size-in-bytes="8192"/>
        <http-protocol default-response-type="AttributeDeprecated" default-type="text/html; charset=iso-8859-1" dns-lookup-enabled="false" forced-response-type="AttributeDeprecated" forced-type="text/html; charset=iso-8859-1" ssl-enabled="true" version="HTTP/1.1"/>
        <http-file-cache file-caching-enabled="false" file-transmission-enabled="false" globally-enabled="false" hash-init-size="0" max-age-in-seconds="30" max-files-count="1024" medium-file-size-limit-in-bytes="537600" medium-file-space-in-bytes="10485760" small-file-size-limit-in-bytes="2048" small-file-space-in-bytes="1048576"/>
        <property name="accessLoggingEnabled" value="false"/>
      </http-service>

Initialization log entries. No Error log at all:
  [#|2008-07-04T11:30:54.770+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;|WEB0302: Starting Sun-Java-System/Application-Server.|#]

[#|2008-07-04T11:30:55.072+0200|INFO|sun-appserver9.1|com.sun.jbi.framework|_ThreadID=13;_ThreadName=pool-1-thread-3;|JBIFW0010: JBI framework ready to accept requests.|#]

[#|2008-07-04T11:30:55.763+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;8173;|WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 8173|#]

[#|2008-07-04T11:30:55.968+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;8274;|WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 8274|#]

[#|2008-07-04T11:30:56.019+0200|INFO|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=10;_ThreadName=main;4941;|WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 4941|#]

[#|2008-07-04T11:30:58.886+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=15;_ThreadName=pool-1-thread-6;/V31;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V31'|#]

[#|2008-07-04T11:30:58.877+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=14;_ThreadName=pool-1-thread-4;/V31;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V31'|#]

[#|2008-07-04T11:30:58.926+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=16;_ThreadName=pool-1-thread-5;/V31;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V31'|#]

[#|2008-07-04T11:30:59.019+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=10;_ThreadName=main;/V31;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V31'|#]

[#|2008-07-04T11:31:03.539+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=14;_ThreadName=pool-1-thread-4;/V32;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V32'|#]

[#|2008-07-04T11:31:03.965+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=10;_ThreadName=main;/V32;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V32'|#]

[#|2008-07-04T11:31:04.018+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=16;_ThreadName=pool-1-thread-5;/V32;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V32'|#]

[#|2008-07-04T11:31:04.097+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=15;_ThreadName=pool-1-thread-6;/V32;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V32'|#]

[#|2008-07-04T11:31:06.646+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=14;_ThreadName=pool-1-thread-4;/V33;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V33'|#]

[#|2008-07-04T11:31:07.567+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=16;_ThreadName=pool-1-thread-5;/V33;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V33'|#]

[#|2008-07-04T11:31:07.845+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=15;_ThreadName=pool-1-thread-6;/V33;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V33'|#]

[#|2008-07-04T11:31:07.847+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=10;_ThreadName=main;/V33;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V33'|#]

[#|2008-07-04T11:31:11.138+0200|INFO|sun-appserver9.1|javax.enterprise.system.core.selfmanagement|_ThreadID=10;_ThreadName=main;|SMGT0007: Self Management Rules service is enabled|#]

[#|2008-07-04T11:31:11.249+0200|INFO|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|Application server startup complete.|#]

[#|2008-07-04T11:33:46.408+0200|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=17;_ThreadName=httpWorkerThread-4941-4;;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context ''|#]
[Message sent by forum member 'aperezymadrid' (aperezymadrid)]

http://forums.java.net/jive/thread.jspa?messageID=284343