JBoss Enterprise Application Platform 4 and 5
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-3008

Clustering tests failing with explicitly specified IPv6 addresses

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 4.2.0.GA_CP08, 4.3.0.GA_CP07
    • Component/s: Testsuite
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Environment:
      All platforms
    • Similar Issues:
      Show 10 results 

      Description

      Many HTTP session-based clustering tests are failing when the testsuite is started up with IPv6 addresses, for example:

      ./build.sh -Dnode0=[3ffe:ffff:0100:f101::1] -Dnode1=[3ffe:ffff:0100:f101::2] -DudpGroup=[ff0e::1:2:3] tests

      When the testsuite is started using domain names which resolve to the same IPv6 addresses, the tests pass:

      ./build.sh -Dnode0=lenovo6a -Dnode1=lenovo6b -DudpGroup=[ff0e::1:2:3] tests

      An example of a typical failure, in the test SimpleTestCase running under UDP:

      Error Message
      getSessionCookie(): fail to find session id. Server name: [fec0:0:a16:ffff::12]
      Stacktrace
      junit.framework.AssertionFailedError: getSessionCookie(): fail to find session id. Server name: [fec0:0:a16:ffff::12]
      at org.jboss.test.cluster.test.BaseTest.getSessionCookie(BaseTest.java:269)
      at org.jboss.test.cluster.test.BaseTest.setCookieDomainToThisServer(BaseTest.java:242)
      at org.jboss.test.cluster.test.SimpleTestCase.testHttpSessionReplication(SimpleTestCase.java:81)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)

      The problem seems to be related to the use of cookies in the HTTP session replication tests.
      Here is a message which is emitted during many of these session based tests:

      2009-10-21 16:30:56,002 WARN [org.apache.commons.httpclient.HttpMethodBase] Cookie rejected: "$Version=0; JSESSIONID=AQYACiGZiyqiFpeNHDA1Ug**; $Path=/". Illegal domain attribute "[fec0". Domain of origin: "[fec0:0:a16:ffff::11]"

      HttpClient seems to be having two problems with cookies:
      it cannot correctly parse cookie domains which are IPv6 addresses (see https://issues.apache.org/jira/browse/HTTPCLIENT-654)
      (ii) even if I fix the issue HTTPCLIENT-654 by modifying the codebase as described, it seems that cookies are still getting rejected - don't know if this is due to the cookie management policy

      The cookie angle may be a red herring, but it was the only difference I could see between a clean run and a failing run.

      1. httpclient-3.0.1-ipv6.patch
        1 kB
        Richard Achmatowicz
      2. httpclient-3.1-ipv6.patch2
        1 kB
        Richard Achmatowicz

        Issue Links

          Activity

          Hide
          Richard Achmatowicz
          added a comment -

          It seems as though HttpClient 3.x is nearing its EOL and we should be upgrading to HttpComponents 4.x

          Show
          Richard Achmatowicz
          added a comment - It seems as though HttpClient 3.x is nearing its EOL and we should be upgrading to HttpComponents 4.x
          Hide
          David Lloyd
          added a comment -

          This one looks to me like "not a bug", since the [] are only for URI usage and are not really valid for IPv6 addresses in general. I'd say the nonstandard use of [] and @ is the unnecessary notation, though I may be missing something else here.

          All I can say about the cookie thing is what RFC 2965 says: "Host name (HN) means either the host domain name (HDN) or the numeric Internet Protocol (IP) address of a host. The fully qualified domain name is preferred; use of numeric IP addresses is strongly discouraged." It doesn't seem to mention IPv6 at all...

          Tracking back the cookie exception to the underlying service, and requiring that service to be configured with a proper domain name, seems like the logical step to me.

          Show
          David Lloyd
          added a comment - This one looks to me like "not a bug", since the [] are only for URI usage and are not really valid for IPv6 addresses in general. I'd say the nonstandard use of [] and @ is the unnecessary notation, though I may be missing something else here. All I can say about the cookie thing is what RFC 2965 says: "Host name (HN) means either the host domain name (HDN) or the numeric Internet Protocol (IP) address of a host. The fully qualified domain name is preferred; use of numeric IP addresses is strongly discouraged." It doesn't seem to mention IPv6 at all... Tracking back the cookie exception to the underlying service, and requiring that service to be configured with a proper domain name, seems like the logical step to me.
          Hide
          Richard Achmatowicz
          added a comment -

          Good point on the [] perhaps messing up the cookies. I'm going to try a test without them to see if it affects the results.

          Show
          Richard Achmatowicz
          added a comment - Good point on the [] perhaps messing up the cookies. I'm going to try a test without them to see if it affects the results.
          Hide
          Richard Achmatowicz
          added a comment -

          From reading the RFC (http://www.faqs.org/rfcs/rfc2109), it staes

          4.3.2 Rejecting Cookies
          To prevent possible security or privacy violations, a user agent rejects a cookie (shall not store its information) if any of the following is true:

          • The value for the Path attribute is not a prefix of the request-URI.
          • The value for the Domain attribute contains no embedded dots or does not start with a dot.
          • The value for the request-host does not domain-match the Domain attribute.
          • The request-host is a FQDN (not IP address) and has the form HD, where D is the value of the Domain attribute, and H is a string that contains one or more dots.

          It may be the second point which is causing cookies to be rejected: the domain 192.168.0.1 (which work as domain strings) contains embedded dots, but IPv6 addresses do not.

          Show
          Richard Achmatowicz
          added a comment - From reading the RFC ( http://www.faqs.org/rfcs/rfc2109 ), it staes 4.3.2 Rejecting Cookies To prevent possible security or privacy violations, a user agent rejects a cookie (shall not store its information) if any of the following is true: The value for the Path attribute is not a prefix of the request-URI. The value for the Domain attribute contains no embedded dots or does not start with a dot. The value for the request-host does not domain-match the Domain attribute. The request-host is a FQDN (not IP address) and has the form HD, where D is the value of the Domain attribute, and H is a string that contains one or more dots. It may be the second point which is causing cookies to be rejected: the domain 192.168.0.1 (which work as domain strings) contains embedded dots, but IPv6 addresses do not.
          Hide
          Richard Achmatowicz
          added a comment -

          Given that:
          domain settings are used in the clustering tests to direct the URL request to the correct server in the case of a clustered setup , and
          (ii) given that they need to correspond to the actual hosts used and
          (iii) given that we cannot use the IPv6 addressses of the hosts but must rather use fully qualified domains names for the hosts
          am I correct in concluding that we have no choice but to set up domain names for all IPv6 addresses we make use of in the QA lab?

          At present, the IP addresses we do use are allocated in an ad-hoc manner and do not have entries in /etc/hosts or DNS.

          I can try to get some added for the small pool of hosts which we do use.

          Show
          Richard Achmatowicz
          added a comment - Given that: domain settings are used in the clustering tests to direct the URL request to the correct server in the case of a clustered setup , and (ii) given that they need to correspond to the actual hosts used and (iii) given that we cannot use the IPv6 addressses of the hosts but must rather use fully qualified domains names for the hosts am I correct in concluding that we have no choice but to set up domain names for all IPv6 addresses we make use of in the QA lab? At present, the IP addresses we do use are allocated in an ad-hoc manner and do not have entries in /etc/hosts or DNS. I can try to get some added for the small pool of hosts which we do use.
          Hide
          Richard Achmatowicz
          added a comment -

          And also either start the tests using those names, or do a reverse DNS lookup within the clustering tests to get the names if the testsuite is started using IP addresses?

          InetAddress ia = InetAddress.getByname(<IPv6 IP address>) ;
          String domain = ia.getCanonicalHostName() ;

          Show
          Richard Achmatowicz
          added a comment - And also either start the tests using those names, or do a reverse DNS lookup within the clustering tests to get the names if the testsuite is started using IP addresses? InetAddress ia = InetAddress.getByname(<IPv6 IP address>) ; String domain = ia.getCanonicalHostName() ;
          Hide
          Brian Stansberry
          added a comment -

          I've been on vacation so haven't been monitoring this. I'm concerned about making changes to the testsuite that will not allow it to run outside a specialized environment. An ordinary community member has to be able to run the testsuite by binding one server to localhost and one to the machine default address, or, since that won't work on Windows, by multihoming the machine and binding one instance to address 1 and the other instance to address 2. It's not likely a reverse DNS lookup of those addresses will work.

          The reverse DNS thing is OK if the address is an IPv6 address. But IPv4 has been working fine for a long time, so let's leave it alone.

          Show
          Brian Stansberry
          added a comment - I've been on vacation so haven't been monitoring this. I'm concerned about making changes to the testsuite that will not allow it to run outside a specialized environment. An ordinary community member has to be able to run the testsuite by binding one server to localhost and one to the machine default address, or, since that won't work on Windows, by multihoming the machine and binding one instance to address 1 and the other instance to address 2. It's not likely a reverse DNS lookup of those addresses will work. The reverse DNS thing is OK if the address is an IPv6 address. But IPv4 has been working fine for a long time, so let's leave it alone.
          Hide
          Richard Achmatowicz
          added a comment -

          Hi Permaine

          No, this will require some more investigation and even more testing, sp probably will have to wait until the next CP.

          Show
          Richard Achmatowicz
          added a comment - Hi Permaine No, this will require some more investigation and even more testing, sp probably will have to wait until the next CP.
          Hide
          Richard Achmatowicz
          added a comment -

          I looked into this issue yesterday in some detail, setting up a server, deploying the http-sr session-oriented web application, and running a mini HttpClient application which calls testsessionattribute.jsp followed by getsessionattribute.jsp, all with IPv4 addresses. It appears that:

          • in processing testsessionattribute.jsp, the server will send a Set-Cookie header with no domain specified, and when HttpClient receives the cookie with no domain, it adds in the hostname of the server as the domain (whether it is an IP address literal or a hostname)
          • in processing getattribute.jsp, the client will go through a cookie matching process and add a Cookie header for every cookie it finds which matches the host name of the server
            Also, if you make a call on a server at a different host hane, the cookie is not sent with the request.
            So this all works as expected with IPv4 literals or domain names which resolve to IPv4 literals.

          Some time ago, I implemented a fix to HttpClient which fixed a parsing issue with IPv6 addresses, tried it and the clustering tests failed. However, I went back yesterday, and tried my mini example and to my surprise the fix allowed my mini example to work.

          Here is a trace before the fix:

          [nrla@localhost httpclient]$ java -classpath .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-unpatched.jar:./log4j.jar:./commons-codec-1.4.jar JBossCookieApp [3ffe:ffff:100:f101::1]:8080" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::1]:8080
          Target URL: [3ffe:ffff:100:f101::1]:8080" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::1]:8080
          DEBUG [main] (?:?) - Java version: 1.5.0_14
          DEBUG [main] (?:?) - Java vendor: Sun Microsystems Inc.
          DEBUG [main] (?:?) - Java class path: .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-unpatched.jar:./log4j.jar:./commons-codec-1.4.jar
          DEBUG [main] (?:?) - Operating system name: Linux
          DEBUG [main] (?:?) - Operating system architecture: i386
          DEBUG [main] (?:?) - Operating system version: 2.6.26.8-57.fc8
          DEBUG [main] (?:?) - SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
          DEBUG [main] (?:?) - SunRsaSign 1.5: Sun RSA signature provider
          DEBUG [main] (?:?) - SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
          DEBUG [main] (?:?) - SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
          DEBUG [main] (?:?) - SunJGSS 1.0: Sun (Kerberos v5)
          DEBUG [main] (?:?) - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)
          DEBUG [main] (?:?) - Set parameter http.useragent = Jakarta Commons-HttpClient/3.1
          DEBUG [main] (?:?) - Set parameter http.protocol.version = HTTP/1.1
          DEBUG [main] (?:?) - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager
          DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = default
          DEBUG [main] (?:?) - Set parameter http.protocol.element-charset = US-ASCII
          DEBUG [main] (?:?) - Set parameter http.protocol.content-charset = ISO-8859-1
          DEBUG [main] (?:?) - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@1319c
          DEBUG [main] (?:?) - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
          DEBUG [main] (?:?) - Set parameter http.connection.timeout = 30000
          DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = rfc2109
          DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::1]:8080
          DEBUG [main] (?:?) - >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1[\r][\n]"
          DEBUG [main] (?:?) - Adding Host request header
          DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
          DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1]:8080[\r][\n]"
          DEBUG [main] (?:?) - >> "[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1[\r][\n]"
          DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0[\r][\n]"
          DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=sxAfjXgHiGY7DBkDmq08Ng**; Path=/[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Length: 167[\r][\n]"
          DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:32 GMT[\r][\n]"
          DEBUG [main] (?:?) - << "[\r][\n]"
          WARN [main] (?:?) - Cookie rejected: "$Version=0; JSESSIONID=sxAfjXgHiGY7DBkDmq08Ng**; $Path=/". Illegal domain attribute "[3ffe". Domain of origin: "[3ffe:ffff:100:f101::1]"
          Response status code: 200
          Present cookies:
          DEBUG [main] (?:?) - << "<html>[\n]"
          DEBUG [main] (?:?) - << "<!-- <body bgcolor=blue> -->[\n]"
          DEBUG [main] (?:?) - << "<center>[\n]"
          DEBUG [main] (?:?) - << "[\n]"
          DEBUG [main] (?:?) - << "<p>Storing session id in attribute with id: sxAfjXgHiGY7DBkDmq08Ng**[\n]"
          DEBUG [main] (?:?) - << "[\n]"
          DEBUG [main] (?:?) - << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1>[\n]"
          DEBUG [main] (?:?) - << "</body>[\n]"
          DEBUG [main] (?:?) - << "</html>[\n]"
          DEBUG [main] (?:?) - Resorting to protocol version default close connection policy
          DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1
          DEBUG [main] (?:?) - Releasing connection back to connection manager.
          DEBUG [main] (?:?) - >> "GET /http-sr/getattribute.jsp HTTP/1.1[\r][\n]"
          DEBUG [main] (?:?) - Adding Host request header
          DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
          DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1]:8080[\r][\n]"
          DEBUG [main] (?:?) - >> "[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1[\r][\n]"
          DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0[\r][\n]"
          DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=UOJtQJzvN1U46+lNwts9CA**; Path=/[\r][\n]"
          DEBUG [main] (?:?) - << "X-SawTestHttpAttribute: false[\r][\n]"
          DEBUG [main] (?:?) - << "X-SessionIsNew: true[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Length: 102[\r][\n]"
          DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:32 GMT[\r][\n]"
          DEBUG [main] (?:?) - << "[\r][\n]"
          WARN [main] (?:?) - Cookie rejected: "$Version=0; JSESSIONID=UOJtQJzvN1U46+lNwts9CA**; $Path=/". Illegal domain attribute "[3ffe". Domain of origin: "[3ffe:ffff:100:f101::1]"
          Response status code: 200
          Present cookies:
          DEBUG [main] (?:?) - << "[\n]"
          DEBUG [main] (?:?) - << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2>[\n]"
          DEBUG [main] (?:?) - << "[\n]"
          DEBUG [main] (?:?) - << "<p>Retrieve the session id from attribute:[\n]"
          DEBUG [main] (?:?) - << "null</p>"
          DEBUG [main] (?:?) - Resorting to protocol version default close connection policy
          DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1
          DEBUG [main] (?:?) - Releasing connection back to connection manager.

          and here is a trace after the fix:

          [nrla@localhost httpclient]$ java -classpath .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar JBossCookieApp [3ffe:ffff:100:f101::1]:8080" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::1]:8080
          Target URL: [3ffe:ffff:100:f101::1]:8080" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::1]:8080
          DEBUG [main] (?:?) - Java version: 1.5.0_14
          DEBUG [main] (?:?) - Java vendor: Sun Microsystems Inc.
          DEBUG [main] (?:?) - Java class path: .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar
          DEBUG [main] (?:?) - Operating system name: Linux
          DEBUG [main] (?:?) - Operating system architecture: i386
          DEBUG [main] (?:?) - Operating system version: 2.6.26.8-57.fc8
          DEBUG [main] (?:?) - SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
          DEBUG [main] (?:?) - SunRsaSign 1.5: Sun RSA signature provider
          DEBUG [main] (?:?) - SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
          DEBUG [main] (?:?) - SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
          DEBUG [main] (?:?) - SunJGSS 1.0: Sun (Kerberos v5)
          DEBUG [main] (?:?) - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)
          DEBUG [main] (?:?) - Set parameter http.useragent = Jakarta Commons-HttpClient/3.1
          DEBUG [main] (?:?) - Set parameter http.protocol.version = HTTP/1.1
          DEBUG [main] (?:?) - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager
          DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = default
          DEBUG [main] (?:?) - Set parameter http.protocol.element-charset = US-ASCII
          DEBUG [main] (?:?) - Set parameter http.protocol.content-charset = ISO-8859-1
          DEBUG [main] (?:?) - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@15212bc
          DEBUG [main] (?:?) - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
          DEBUG [main] (?:?) - Set parameter http.connection.timeout = 30000
          DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = rfc2109
          DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::1]:8080
          DEBUG [main] (?:?) - >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1[\r][\n]"
          DEBUG [main] (?:?) - Adding Host request header
          DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
          DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1]:8080[\r][\n]"
          DEBUG [main] (?:?) - >> "[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1[\r][\n]"
          DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0[\r][\n]"
          DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**; Path=/[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Length: 167[\r][\n]"
          DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:48 GMT[\r][\n]"
          DEBUG [main] (?:?) - << "[\r][\n]"
          DEBUG [main] (?:?) - Cookie accepted: "$Version=0; JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**; $Path=/"
          Response status code: 200
          Present cookies:
          Cookie fun facts:

          • JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**
            Domain:[3ffe:ffff:100:f101::1]
            Path:/
            Date:null
            DEBUG [main] (?:?) - << "<html>[\n]"
            DEBUG [main] (?:?) - << "<!-- <body bgcolor=blue> -->[\n]"
            DEBUG [main] (?:?) - << "<center>[\n]"
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<p>Storing session id in attribute with id: qerkbD2fiFN7Nyg3mWUAvQ**[\n]"
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1>[\n]"
            DEBUG [main] (?:?) - << "</body>[\n]"
            DEBUG [main] (?:?) - << "</html>[\n]"
            DEBUG [main] (?:?) - Resorting to protocol version default close connection policy
            DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1
            DEBUG [main] (?:?) - Releasing connection back to connection manager.
            DEBUG [main] (?:?) - >> "GET /http-sr/getattribute.jsp HTTP/1.1[\r][\n]"
            DEBUG [main] (?:?) - Adding Host request header
            DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
            DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1]:8080[\r][\n]"
            DEBUG [main] (?:?) - >> "Cookie: $Version=0; JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**; $Path=/[\r][\n]"
            DEBUG [main] (?:?) - >> "[\r][\n]"
            DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
            DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
            DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1[\r][\n]"
            DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0[\r][\n]"
            DEBUG [main] (?:?) - << "X-SawTestHttpAttribute: true[\r][\n]"
            DEBUG [main] (?:?) - << "X-SessionIsNew: false[\r][\n]"
            DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
            DEBUG [main] (?:?) - << "Content-Length: 122[\r][\n]"
            DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:48 GMT[\r][\n]"
            DEBUG [main] (?:?) - << "[\r][\n]"
            Response status code: 200
            Present cookies:
            Cookie fun facts:
          • JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**
            Domain:[3ffe:ffff:100:f101::1]
            Path:/
            Date:null
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2>[\n]"
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<p>Retrieve the session id from attribute:[\n]"
            DEBUG [main] (?:?) - << "qerkbD2fiFN7Nyg3mWUAvQ**</p>"
            DEBUG [main] (?:?) - Resorting to protocol version default close connection policy
            DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1
            DEBUG [main] (?:?) - Releasing connection back to connection manager.

          So, it appears that with a patched httpclient-3.1 jar, we can use IPv6 literals as domain names, and they do cause cookies to be processed correctly.

          I also found that the IP address redirect (by resetting the domain name) will also work with the patched jar:

          [nrla@localhost httpclient]$ java -cp .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar JBossCookieApp2 [3ffe:ffff:100:f101:0:0:0:1]:8080" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101:0:0:0:1]:8080
          Target URL: [3ffe:ffff:100:f101:0:0:0:1]:8080" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101:0:0:0:1]:8080
          DEBUG [main] (?:?) - Java version: 1.5.0_14
          DEBUG [main] (?:?) - Java vendor: Sun Microsystems Inc.
          DEBUG [main] (?:?) - Java class path: .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar
          DEBUG [main] (?:?) - Operating system name: Linux
          DEBUG [main] (?:?) - Operating system architecture: i386
          DEBUG [main] (?:?) - Operating system version: 2.6.26.8-57.fc8
          DEBUG [main] (?:?) - SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
          DEBUG [main] (?:?) - SunRsaSign 1.5: Sun RSA signature provider
          DEBUG [main] (?:?) - SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
          DEBUG [main] (?:?) - SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
          DEBUG [main] (?:?) - SunJGSS 1.0: Sun (Kerberos v5)
          DEBUG [main] (?:?) - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5)
          DEBUG [main] (?:?) - Set parameter http.useragent = Jakarta Commons-HttpClient/3.1
          DEBUG [main] (?:?) - Set parameter http.protocol.version = HTTP/1.1
          DEBUG [main] (?:?) - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager
          DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = default
          DEBUG [main] (?:?) - Set parameter http.protocol.element-charset = US-ASCII
          DEBUG [main] (?:?) - Set parameter http.protocol.content-charset = ISO-8859-1
          DEBUG [main] (?:?) - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@1e152c5
          DEBUG [main] (?:?) - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
          DEBUG [main] (?:?) - Set parameter http.connection.timeout = 30000
          DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = rfc2109
          DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::1]:8080
          DEBUG [main] (?:?) - >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1[\r][\n]"
          DEBUG [main] (?:?) - Adding Host request header
          DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
          DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1]:8080[\r][\n]"
          DEBUG [main] (?:?) - >> "[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
          DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1[\r][\n]"
          DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0[\r][\n]"
          DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**; Path=/[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
          DEBUG [main] (?:?) - << "Content-Length: 167[\r][\n]"
          DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 17:23:36 GMT[\r][\n]"
          DEBUG [main] (?:?) - << "[\r][\n]"
          DEBUG [main] (?:?) - Cookie accepted: "$Version=0; JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**; $Path=/"
          Response status code: 200
          Present cookies:
          Cookie fun facts:

          • JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**
            Domain:[3ffe:ffff:100:f101::1]
            Path:/
            Date:null
            DEBUG [main] (?:?) - << "<html>[\n]"
            DEBUG [main] (?:?) - << "<!-- <body bgcolor=blue> -->[\n]"
            DEBUG [main] (?:?) - << "<center>[\n]"
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<p>Storing session id in attribute with id: fLftTJ6ozoqJ0oTvJ9ZOPA**[\n]"
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1>[\n]"
            DEBUG [main] (?:?) - << "</body>[\n]"
            DEBUG [main] (?:?) - << "</html>[\n]"
            DEBUG [main] (?:?) - Resorting to protocol version default close connection policy
            DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1
            DEBUG [main] (?:?) - Releasing connection back to connection manager.
            DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::2]:8080
            DEBUG [main] (?:?) - >> "GET /http-sr/getattribute.jsp HTTP/1.1[\r][\n]"
            DEBUG [main] (?:?) - Adding Host request header
            DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
            DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::2]:8080[\r][\n]"
            DEBUG [main] (?:?) - >> "Cookie: $Version=0; JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**; $Path=/[\r][\n]"
            DEBUG [main] (?:?) - >> "[\r][\n]"
            DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
            DEBUG [main] (?:?) - << "HTTP/1.1 200 OK[\r][\n]"
            DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1[\r][\n]"
            DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0[\r][\n]"
            DEBUG [main] (?:?) - << "X-SawTestHttpAttribute: true[\r][\n]"
            DEBUG [main] (?:?) - << "X-SessionIsNew: false[\r][\n]"
            DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
            DEBUG [main] (?:?) - << "Content-Length: 122[\r][\n]"
            DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 17:23:37 GMT[\r][\n]"
            DEBUG [main] (?:?) - << "[\r][\n]"
            Response status code: 200
            Present cookies:
            Cookie fun facts:
          • JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**
            Domain:[3ffe:ffff:100:f101::2]
            Path:/
            Date:null
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2>[\n]"
            DEBUG [main] (?:?) - << "[\n]"
            DEBUG [main] (?:?) - << "<p>Retrieve the session id from attribute:[\n]"
            DEBUG [main] (?:?) - << "fLftTJ6ozoqJ0oTvJ9ZOPA**</p>"
            DEBUG [main] (?:?) - Resorting to protocol version default close connection policy
            DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1
            DEBUG [main] (?:?) - Releasing connection back to connection manager.

          So, i'm going to have a second look at replacing the patched jar and retrying the clustering tests.

          Show
          Richard Achmatowicz
          added a comment - I looked into this issue yesterday in some detail, setting up a server, deploying the http-sr session-oriented web application, and running a mini HttpClient application which calls testsessionattribute.jsp followed by getsessionattribute.jsp, all with IPv4 addresses. It appears that: in processing testsessionattribute.jsp, the server will send a Set-Cookie header with no domain specified, and when HttpClient receives the cookie with no domain, it adds in the hostname of the server as the domain (whether it is an IP address literal or a hostname) in processing getattribute.jsp, the client will go through a cookie matching process and add a Cookie header for every cookie it finds which matches the host name of the server Also, if you make a call on a server at a different host hane, the cookie is not sent with the request. So this all works as expected with IPv4 literals or domain names which resolve to IPv4 literals. Some time ago, I implemented a fix to HttpClient which fixed a parsing issue with IPv6 addresses, tried it and the clustering tests failed. However, I went back yesterday, and tried my mini example and to my surprise the fix allowed my mini example to work. Here is a trace before the fix: [nrla@localhost httpclient] $ java -classpath .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-unpatched.jar:./log4j.jar:./commons-codec-1.4.jar JBossCookieApp [3ffe:ffff:100:f101::1] :8080" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::1] :8080 Target URL: [3ffe:ffff:100:f101::1] :8080" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::1] :8080 DEBUG [main] (?:?) - Java version: 1.5.0_14 DEBUG [main] (?:?) - Java vendor: Sun Microsystems Inc. DEBUG [main] (?:?) - Java class path: .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-unpatched.jar:./log4j.jar:./commons-codec-1.4.jar DEBUG [main] (?:?) - Operating system name: Linux DEBUG [main] (?:?) - Operating system architecture: i386 DEBUG [main] (?:?) - Operating system version: 2.6.26.8-57.fc8 DEBUG [main] (?:?) - SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores) DEBUG [main] (?:?) - SunRsaSign 1.5: Sun RSA signature provider DEBUG [main] (?:?) - SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1) DEBUG [main] (?:?) - SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC) DEBUG [main] (?:?) - SunJGSS 1.0: Sun (Kerberos v5) DEBUG [main] (?:?) - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5) DEBUG [main] (?:?) - Set parameter http.useragent = Jakarta Commons-HttpClient/3.1 DEBUG [main] (?:?) - Set parameter http.protocol.version = HTTP/1.1 DEBUG [main] (?:?) - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = default DEBUG [main] (?:?) - Set parameter http.protocol.element-charset = US-ASCII DEBUG [main] (?:?) - Set parameter http.protocol.content-charset = ISO-8859-1 DEBUG [main] (?:?) - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@1319c DEBUG [main] (?:?) - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z] DEBUG [main] (?:?) - Set parameter http.connection.timeout = 30000 DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = rfc2109 DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::1] :8080 DEBUG [main] (?:?) - >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1 [\r] [\n] " DEBUG [main] (?:?) - Adding Host request header DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1] :8080 [\r] [\n] " DEBUG [main] (?:?) - >> " [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1 [\r] [\n] " DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0 [\r] [\n] " DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=sxAfjXgHiGY7DBkDmq08Ng**; Path=/ [\r] [\n] " DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " DEBUG [main] (?:?) - << "Content-Length: 167 [\r] [\n] " DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:32 GMT [\r] [\n] " DEBUG [main] (?:?) - << " [\r] [\n] " WARN [main] (?:?) - Cookie rejected: "$Version=0; JSESSIONID=sxAfjXgHiGY7DBkDmq08Ng**; $Path=/". Illegal domain attribute "[3ffe". Domain of origin: " [3ffe:ffff:100:f101::1] " Response status code: 200 Present cookies: DEBUG [main] (?:?) - << "<html> [\n] " DEBUG [main] (?:?) - << "<!-- <body bgcolor=blue> --> [\n] " DEBUG [main] (?:?) - << "<center> [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<p>Storing session id in attribute with id: sxAfjXgHiGY7DBkDmq08Ng** [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1> [\n] " DEBUG [main] (?:?) - << "</body> [\n] " DEBUG [main] (?:?) - << "</html> [\n] " DEBUG [main] (?:?) - Resorting to protocol version default close connection policy DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1 DEBUG [main] (?:?) - Releasing connection back to connection manager. DEBUG [main] (?:?) - >> "GET /http-sr/getattribute.jsp HTTP/1.1 [\r] [\n] " DEBUG [main] (?:?) - Adding Host request header DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1] :8080 [\r] [\n] " DEBUG [main] (?:?) - >> " [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1 [\r] [\n] " DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0 [\r] [\n] " DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=UOJtQJzvN1U46+lNwts9CA**; Path=/ [\r] [\n] " DEBUG [main] (?:?) - << "X-SawTestHttpAttribute: false [\r] [\n] " DEBUG [main] (?:?) - << "X-SessionIsNew: true [\r] [\n] " DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " DEBUG [main] (?:?) - << "Content-Length: 102 [\r] [\n] " DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:32 GMT [\r] [\n] " DEBUG [main] (?:?) - << " [\r] [\n] " WARN [main] (?:?) - Cookie rejected: "$Version=0; JSESSIONID=UOJtQJzvN1U46+lNwts9CA**; $Path=/". Illegal domain attribute "[3ffe". Domain of origin: " [3ffe:ffff:100:f101::1] " Response status code: 200 Present cookies: DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2> [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<p>Retrieve the session id from attribute: [\n] " DEBUG [main] (?:?) - << "null</p>" DEBUG [main] (?:?) - Resorting to protocol version default close connection policy DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1 DEBUG [main] (?:?) - Releasing connection back to connection manager. and here is a trace after the fix: [nrla@localhost httpclient] $ java -classpath .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar JBossCookieApp [3ffe:ffff:100:f101::1] :8080" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::1] :8080 Target URL: [3ffe:ffff:100:f101::1] :8080" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::1] :8080 DEBUG [main] (?:?) - Java version: 1.5.0_14 DEBUG [main] (?:?) - Java vendor: Sun Microsystems Inc. DEBUG [main] (?:?) - Java class path: .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar DEBUG [main] (?:?) - Operating system name: Linux DEBUG [main] (?:?) - Operating system architecture: i386 DEBUG [main] (?:?) - Operating system version: 2.6.26.8-57.fc8 DEBUG [main] (?:?) - SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores) DEBUG [main] (?:?) - SunRsaSign 1.5: Sun RSA signature provider DEBUG [main] (?:?) - SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1) DEBUG [main] (?:?) - SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC) DEBUG [main] (?:?) - SunJGSS 1.0: Sun (Kerberos v5) DEBUG [main] (?:?) - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5) DEBUG [main] (?:?) - Set parameter http.useragent = Jakarta Commons-HttpClient/3.1 DEBUG [main] (?:?) - Set parameter http.protocol.version = HTTP/1.1 DEBUG [main] (?:?) - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = default DEBUG [main] (?:?) - Set parameter http.protocol.element-charset = US-ASCII DEBUG [main] (?:?) - Set parameter http.protocol.content-charset = ISO-8859-1 DEBUG [main] (?:?) - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@15212bc DEBUG [main] (?:?) - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z] DEBUG [main] (?:?) - Set parameter http.connection.timeout = 30000 DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = rfc2109 DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::1] :8080 DEBUG [main] (?:?) - >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1 [\r] [\n] " DEBUG [main] (?:?) - Adding Host request header DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1] :8080 [\r] [\n] " DEBUG [main] (?:?) - >> " [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1 [\r] [\n] " DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0 [\r] [\n] " DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**; Path=/ [\r] [\n] " DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " DEBUG [main] (?:?) - << "Content-Length: 167 [\r] [\n] " DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:48 GMT [\r] [\n] " DEBUG [main] (?:?) - << " [\r] [\n] " DEBUG [main] (?:?) - Cookie accepted: "$Version=0; JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**; $Path=/" Response status code: 200 Present cookies: Cookie fun facts: JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ** Domain: [3ffe:ffff:100:f101::1] Path:/ Date:null DEBUG [main] (?:?) - << "<html> [\n] " DEBUG [main] (?:?) - << "<!-- <body bgcolor=blue> --> [\n] " DEBUG [main] (?:?) - << "<center> [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<p>Storing session id in attribute with id: qerkbD2fiFN7Nyg3mWUAvQ** [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1> [\n] " DEBUG [main] (?:?) - << "</body> [\n] " DEBUG [main] (?:?) - << "</html> [\n] " DEBUG [main] (?:?) - Resorting to protocol version default close connection policy DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1 DEBUG [main] (?:?) - Releasing connection back to connection manager. DEBUG [main] (?:?) - >> "GET /http-sr/getattribute.jsp HTTP/1.1 [\r] [\n] " DEBUG [main] (?:?) - Adding Host request header DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1] :8080 [\r] [\n] " DEBUG [main] (?:?) - >> "Cookie: $Version=0; JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ**; $Path=/ [\r] [\n] " DEBUG [main] (?:?) - >> " [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1 [\r] [\n] " DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0 [\r] [\n] " DEBUG [main] (?:?) - << "X-SawTestHttpAttribute: true [\r] [\n] " DEBUG [main] (?:?) - << "X-SessionIsNew: false [\r] [\n] " DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " DEBUG [main] (?:?) - << "Content-Length: 122 [\r] [\n] " DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 16:59:48 GMT [\r] [\n] " DEBUG [main] (?:?) - << " [\r] [\n] " Response status code: 200 Present cookies: Cookie fun facts: JSESSIONID=qerkbD2fiFN7Nyg3mWUAvQ** Domain: [3ffe:ffff:100:f101::1] Path:/ Date:null DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2> [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<p>Retrieve the session id from attribute: [\n] " DEBUG [main] (?:?) - << "qerkbD2fiFN7Nyg3mWUAvQ**</p>" DEBUG [main] (?:?) - Resorting to protocol version default close connection policy DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1 DEBUG [main] (?:?) - Releasing connection back to connection manager. So, it appears that with a patched httpclient-3.1 jar, we can use IPv6 literals as domain names, and they do cause cookies to be processed correctly. I also found that the IP address redirect (by resetting the domain name) will also work with the patched jar: [nrla@localhost httpclient] $ java -cp .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar JBossCookieApp2 [3ffe:ffff:100:f101:0:0:0:1] :8080" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101:0:0:0:1] :8080 Target URL: [3ffe:ffff:100:f101:0:0:0:1] :8080" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101:0:0:0:1] :8080 DEBUG [main] (?:?) - Java version: 1.5.0_14 DEBUG [main] (?:?) - Java vendor: Sun Microsystems Inc. DEBUG [main] (?:?) - Java class path: .:./commons-logging.jar:./commons-httpclient-3.1/commons-httpclient-3.x-patched.jar:./log4j.jar:./commons-codec-1.4.jar DEBUG [main] (?:?) - Operating system name: Linux DEBUG [main] (?:?) - Operating system architecture: i386 DEBUG [main] (?:?) - Operating system version: 2.6.26.8-57.fc8 DEBUG [main] (?:?) - SUN 1.5: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores) DEBUG [main] (?:?) - SunRsaSign 1.5: Sun RSA signature provider DEBUG [main] (?:?) - SunJSSE 1.5: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1) DEBUG [main] (?:?) - SunJCE 1.5: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC) DEBUG [main] (?:?) - SunJGSS 1.0: Sun (Kerberos v5) DEBUG [main] (?:?) - SunSASL 1.5: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5) DEBUG [main] (?:?) - Set parameter http.useragent = Jakarta Commons-HttpClient/3.1 DEBUG [main] (?:?) - Set parameter http.protocol.version = HTTP/1.1 DEBUG [main] (?:?) - Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = default DEBUG [main] (?:?) - Set parameter http.protocol.element-charset = US-ASCII DEBUG [main] (?:?) - Set parameter http.protocol.content-charset = ISO-8859-1 DEBUG [main] (?:?) - Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@1e152c5 DEBUG [main] (?:?) - Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z] DEBUG [main] (?:?) - Set parameter http.connection.timeout = 30000 DEBUG [main] (?:?) - Set parameter http.protocol.cookie-policy = rfc2109 DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::1] :8080 DEBUG [main] (?:?) - >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1 [\r] [\n] " DEBUG [main] (?:?) - Adding Host request header DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::1] :8080 [\r] [\n] " DEBUG [main] (?:?) - >> " [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1 [\r] [\n] " DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0 [\r] [\n] " DEBUG [main] (?:?) - << "Set-Cookie: JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**; Path=/ [\r] [\n] " DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " DEBUG [main] (?:?) - << "Content-Length: 167 [\r] [\n] " DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 17:23:36 GMT [\r] [\n] " DEBUG [main] (?:?) - << " [\r] [\n] " DEBUG [main] (?:?) - Cookie accepted: "$Version=0; JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**; $Path=/" Response status code: 200 Present cookies: Cookie fun facts: JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA** Domain: [3ffe:ffff:100:f101::1] Path:/ Date:null DEBUG [main] (?:?) - << "<html> [\n] " DEBUG [main] (?:?) - << "<!-- <body bgcolor=blue> --> [\n] " DEBUG [main] (?:?) - << "<center> [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<p>Storing session id in attribute with id: fLftTJ6ozoqJ0oTvJ9ZOPA** [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1> [\n] " DEBUG [main] (?:?) - << "</body> [\n] " DEBUG [main] (?:?) - << "</html> [\n] " DEBUG [main] (?:?) - Resorting to protocol version default close connection policy DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1 DEBUG [main] (?:?) - Releasing connection back to connection manager. DEBUG [main] (?:?) - Open connection to [3ffe:ffff:100:f101::2] :8080 DEBUG [main] (?:?) - >> "GET /http-sr/getattribute.jsp HTTP/1.1 [\r] [\n] " DEBUG [main] (?:?) - Adding Host request header DEBUG [main] (?:?) - >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " DEBUG [main] (?:?) - >> "Host: [3ffe:ffff:100:f101::2] :8080 [\r] [\n] " DEBUG [main] (?:?) - >> "Cookie: $Version=0; JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA**; $Path=/ [\r] [\n] " DEBUG [main] (?:?) - >> " [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "HTTP/1.1 200 OK [\r] [\n] " DEBUG [main] (?:?) - << "Server: Apache-Coyote/1.1 [\r] [\n] " DEBUG [main] (?:?) - << "X-Powered-By: Servlet 2.4; JBoss-4.3.0.GA_CP07 (build: SVNTag=JBPAPP_4_3_0_GA_CP07 date=200910271434)/JBossWeb-2.0 [\r] [\n] " DEBUG [main] (?:?) - << "X-SawTestHttpAttribute: true [\r] [\n] " DEBUG [main] (?:?) - << "X-SessionIsNew: false [\r] [\n] " DEBUG [main] (?:?) - << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " DEBUG [main] (?:?) - << "Content-Length: 122 [\r] [\n] " DEBUG [main] (?:?) - << "Date: Thu, 05 Nov 2009 17:23:37 GMT [\r] [\n] " DEBUG [main] (?:?) - << " [\r] [\n] " Response status code: 200 Present cookies: Cookie fun facts: JSESSIONID=fLftTJ6ozoqJ0oTvJ9ZOPA** Domain: [3ffe:ffff:100:f101::2] Path:/ Date:null DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2> [\n] " DEBUG [main] (?:?) - << " [\n] " DEBUG [main] (?:?) - << "<p>Retrieve the session id from attribute: [\n] " DEBUG [main] (?:?) - << "fLftTJ6ozoqJ0oTvJ9ZOPA**</p>" DEBUG [main] (?:?) - Resorting to protocol version default close connection policy DEBUG [main] (?:?) - Should NOT close connection, using HTTP/1.1 DEBUG [main] (?:?) - Releasing connection back to connection manager. So, i'm going to have a second look at replacing the patched jar and retrying the clustering tests.
          Hide
          Richard Achmatowicz
          added a comment -

          The patched version of HttpClient seems to do the trick. The clustering tests are now passing with IPv6 addresses.
          The mistake I made when I tried this earlier is that I didn't replace all copies of commons-httpclient.jar in the EAP distribition - there are about six of them.

          I've set up a test run of the 4.2 CP branch which will copy the patched jars in here:

          http://hudson.qa.jboss.com/hudson/view/EAP-CI/job/eap-as-4.2.x-testsuite-ipv6/

          Show
          Richard Achmatowicz
          added a comment - The patched version of HttpClient seems to do the trick. The clustering tests are now passing with IPv6 addresses. The mistake I made when I tried this earlier is that I didn't replace all copies of commons-httpclient.jar in the EAP distribition - there are about six of them. I've set up a test run of the 4.2 CP branch which will copy the patched jars in here: http://hudson.qa.jboss.com/hudson/view/EAP-CI/job/eap-as-4.2.x-testsuite-ipv6/
          Hide
          Richard Achmatowicz
          added a comment -

          All clustering tests passing except TCP-based tests. Should be something simple. Looking into it.

          Show
          Richard Achmatowicz
          added a comment - All clustering tests passing except TCP-based tests. Should be something simple. Looking into it.
          Hide
          Richard Achmatowicz
          added a comment -

          The reason why the TCP tests are failing:

          1. TCPPING is not initializing correctly, and the second process to start never has a correct view of the group:

          19:14:42,303 INFO [DefaultPartition] Suspected member: 3ffe:ffff:100:f101:0:0:0:1:7800
          19:14:42,442 INFO [DefaultPartition] New cluster view for partition DefaultPartition (id: 2, delta: -1) : [3ffe:ffff:100:f101:0:0:0:2:1099]
          19:14:42,443 INFO [DefaultPartition] I am (3ffe:ffff:100:f101:0:0:0:2:1099) received membershipChanged event:
          19:14:42,444 INFO [DefaultPartition] Dead members: 1 ([3ffe:ffff:100:f101:0:0:0:1:1099])
          19:14:42,444 INFO [DefaultPartition] New Members : 0 ([])
          19:14:42,444 INFO [DefaultPartition] All Members : 1 ([3ffe:ffff:100:f101:0:0:0:2:1099])

          2. The reason TCPPING is not initializing correctly is because we are passing it an invalid initial_hosts string:

          initial_hosts="[3ffe:ffff:100:f101::1][7800],[3ffe:ffff:100:f101::2][7800]"

          which leads to

          19:08:27,900 INFO [JChannel] JGroups version: 2.4.7.GA
          19:08:28,122 ERROR [TCPPING] exeption is java.lang.NumberFormatException: For input string: "3ffe:ffff:100:f101::1"
          19:08:28,123 ERROR [TCPPING] exeption is java.lang.NumberFormatException: For input string: "3ffe:ffff:100:f101::2"

          3. The reason we are passing an invalid initial_hosts string is to workaround the fact that the AS does not handle IPv6 URLs correctly, and we have to start the AS with the bind_address in square brackets:

          ./run.sh -b [3ffe:ffff:100:f101::1] -c all

          This helps to start the AS in that URLs are now correctly formed, and for InetAddresses, the brackets are ignored by InetAddress.getByName(). But it breaks TCPPING parsing.

          Passing a non-bracketed IPv6 address will fix this issue, hoever, the AS will not start: see JBPAPP-3018.

          Show
          Richard Achmatowicz
          added a comment - The reason why the TCP tests are failing: 1. TCPPING is not initializing correctly, and the second process to start never has a correct view of the group: 19:14:42,303 INFO [DefaultPartition] Suspected member: 3ffe:ffff:100:f101:0:0:0:1:7800 19:14:42,442 INFO [DefaultPartition] New cluster view for partition DefaultPartition (id: 2, delta: -1) : [3ffe:ffff:100:f101:0:0:0:2:1099] 19:14:42,443 INFO [DefaultPartition] I am (3ffe:ffff:100:f101:0:0:0:2:1099) received membershipChanged event: 19:14:42,444 INFO [DefaultPartition] Dead members: 1 ( [3ffe:ffff:100:f101:0:0:0:1:1099] ) 19:14:42,444 INFO [DefaultPartition] New Members : 0 ([]) 19:14:42,444 INFO [DefaultPartition] All Members : 1 ( [3ffe:ffff:100:f101:0:0:0:2:1099] ) 2. The reason TCPPING is not initializing correctly is because we are passing it an invalid initial_hosts string: initial_hosts=" [3ffe:ffff:100:f101::1] [7800] , [3ffe:ffff:100:f101::2] [7800] " which leads to 19:08:27,900 INFO [JChannel] JGroups version: 2.4.7.GA 19:08:28,122 ERROR [TCPPING] exeption is java.lang.NumberFormatException: For input string: "3ffe:ffff:100:f101::1" 19:08:28,123 ERROR [TCPPING] exeption is java.lang.NumberFormatException: For input string: "3ffe:ffff:100:f101::2" 3. The reason we are passing an invalid initial_hosts string is to workaround the fact that the AS does not handle IPv6 URLs correctly, and we have to start the AS with the bind_address in square brackets: ./run.sh -b [3ffe:ffff:100:f101::1] -c all This helps to start the AS in that URLs are now correctly formed, and for InetAddresses, the brackets are ignored by InetAddress.getByName(). But it breaks TCPPING parsing. Passing a non-bracketed IPv6 address will fix this issue, hoever, the AS will not start: see JBPAPP-3018 .
          Hide
          Richard Achmatowicz
          added a comment -

          For the record, now that the testsuite has been fixed to start with -b <IPv6 address> (with no enclosing brackets), we now have a new version of this cookie problem.
          Here is a trace:

          2009-11-16 11:28:03,549 INFO [org.jboss.test.cluster.test.SimpleTestCase] makeGet(): trying to get from url [3ffe:ffff:100:f101::1]:8080/http-sr/testsessionreplication.jsp" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::1]:8080/http-sr/testsessionreplication.jsp
          2009-11-16 11:28:03,649 DEBUG [org.apache.commons.httpclient.HttpConnection] Open connection to [3ffe:ffff:100:f101::1]:8080
          2009-11-16 11:28:03,652 DEBUG [httpclient.wire.header] >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1[\r][\n]"
          2009-11-16 11:28:03,653 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Adding Host request header
          2009-11-16 11:28:03,674 DEBUG [httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
          2009-11-16 11:28:03,674 DEBUG [httpclient.wire.header] >> "Host: [3ffe:ffff:100:f101::1]:8080[\r][\n]"
          2009-11-16 11:28:03,675 DEBUG [httpclient.wire.header] >> "[\r][\n]"
          2009-11-16 11:28:03,811 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
          2009-11-16 11:28:03,811 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
          2009-11-16 11:28:03,812 DEBUG [httpclient.wire.header] << "Server: Apache-Coyote/1.1[\r][\n]"
          2009-11-16 11:28:03,812 DEBUG [httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP07 (build: SVNTag=JBPAPP_4_2_0_GA_CP07 date=200911131304)/JBossWeb-2.0[\r][\n]"
          2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Set-Cookie: JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**; Path=/[\r][\n]"
          2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
          2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Content-Length: 167[\r][\n]"
          2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Date: Mon, 16 Nov 2009 16:28:03 GMT[\r][\n]"
          2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "[\r][\n]"
          2009-11-16 11:28:03,816 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Cookie accepted: "$Version=0; JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**; $Path=/"
          2009-11-16 11:28:03,818 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Buffering response body
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<html>[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<!-- <body bgcolor=blue> -->[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<center>[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<p>Storing session id in attribute with id: uCtp2TP1sHh5FcMOpnIG5g**[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1>[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "</body>[\n]"
          2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "</html>[\n]"
          2009-11-16 11:28:03,819 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Resorting to protocol version default close connection policy
          2009-11-16 11:28:03,819 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Should NOT close connection, using HTTP/1.1
          2009-11-16 11:28:03,819 DEBUG [org.apache.commons.httpclient.HttpConnection] Releasing connection back to connection manager.
          2009-11-16 11:28:03,827 DEBUG [httpclient.wire.header] >> "GET /http-sr/getattribute.jsp HTTP/1.1[\r][\n]"
          2009-11-16 11:28:03,827 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Adding Host request header
          2009-11-16 11:28:03,827 DEBUG [httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
          2009-11-16 11:28:03,827 DEBUG [httpclient.wire.header] >> "Host: [3ffe:ffff:100:f101::1]:8080[\r][\n]"
          2009-11-16 11:28:03,828 DEBUG [httpclient.wire.header] >> "Cookie: $Version=0; JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**; $Path=/[\r][\n]"
          2009-11-16 11:28:03,828 DEBUG [httpclient.wire.header] >> "[\r][\n]"
          2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
          2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK[\r][\n]"
          2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "Server: Apache-Coyote/1.1[\r][\n]"
          2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP07 (build: SVNTag=JBPAPP_4_2_0_GA_CP07 date=200911131304)/JBossWeb-2.0[\r][\n]"
          2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "X-SawTestHttpAttribute: true[\r][\n]"
          2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "X-SessionIsNew: false[\r][\n]"
          2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.header] << "Content-Length: 122[\r][\n]"
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.header] << "Date: Mon, 16 Nov 2009 16:28:03 GMT[\r][\n]"
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.header] << "[\r][\n]"
          2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Buffering response body
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "[\n]"
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2>[\n]"
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "[\n]"
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "<p>Retrieve the session id from attribute:[\n]"
          2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "uCtp2TP1sHh5FcMOpnIG5g**</p>"
          2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Resorting to protocol version default close connection policy
          2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Should NOT close connection, using HTTP/1.1
          2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpConnection] Releasing connection back to connection manager.
          2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Client side cookies for server: 3ffe:ffff:100:f101::2
          2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: path: /
          2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: path specified(by server)?: true
          2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: domain: [3ffe:ffff:100:f101::1]
          2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: domain specified(by server)?: false
          2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: expiry: null
          2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: external form: JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**
          2009-11-16 11:28:04,456 INFO [org.jboss.test.cluster.test.SimpleTestCase] Saw JSESSIONID=JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**
          2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Client side cookies for server: 3ffe:ffff:100:f101::2
          2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: path: /
          2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: path specified(by server)?: true
          2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: domain: 3ffe:ffff:100:f101:
          2009-11-16 11:28:04,457 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: domain specified(by server)?: false
          2009-11-16 11:28:04,457 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: expiry: null
          2009-11-16 11:28:04,457 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie[0]: external form: JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**
          2009-11-16 11:28:04,457 INFO [org.jboss.test.cluster.test.SimpleTestCase] makeGet(): trying to get from url [3ffe:ffff:100:f101::2]:8080/http-sr/getattribute.jsp" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::2]:8080/http-sr/getattribute.jsp

          0. We call the servlet [3ffe:ffff:100:f101::1]:8080/http-sr/testsessionreplication.jsp" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::1]:8080/http-sr/testsessionreplication.jsp
          1. When SimpleTestCase calls a session-oriented servlet, the server sends back a cookie but does not set the domain. So the HttpClient sets the domain to the hostname portion of the URL - that is [3ffe:ffff:100:f101::1]
          2. When later in the test case, we want to reset the domain to the second server, we call Cookie.setDomain() with the host name of the server 3ffe:ffff:100:f101::1, which differs from the previous call used to set the domain by the brackets
          3. When HttpClient sends out the next request [3ffe:ffff:100:f101::2]:8080/http-sr/getattribute.jsp" class="external-link" rel="nofollow">http://[3ffe:ffff:100:f101::2]:8080/http-sr/getattribute.jsp, it looks for cookies which match the hostname part of the URL [3ffe:ffff:100:f101::1] and does not find any. So no cookies gets attached.

          In this case, HttpClient needs to be modified not to throw out the cookie (as before) and (ii) we now need to be able to handle server domains for IPv6 literals being set both with and without brackets, somehow. Thinking about it.

          Show
          Richard Achmatowicz
          added a comment - For the record, now that the testsuite has been fixed to start with -b <IPv6 address> (with no enclosing brackets), we now have a new version of this cookie problem. Here is a trace: 2009-11-16 11:28:03,549 INFO [org.jboss.test.cluster.test.SimpleTestCase] makeGet(): trying to get from url [3ffe:ffff:100:f101::1] :8080/http-sr/testsessionreplication.jsp" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::1] :8080/http-sr/testsessionreplication.jsp 2009-11-16 11:28:03,649 DEBUG [org.apache.commons.httpclient.HttpConnection] Open connection to [3ffe:ffff:100:f101::1] :8080 2009-11-16 11:28:03,652 DEBUG [httpclient.wire.header] >> "GET /http-sr/testsessionreplication.jsp HTTP/1.1 [\r] [\n] " 2009-11-16 11:28:03,653 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Adding Host request header 2009-11-16 11:28:03,674 DEBUG [httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " 2009-11-16 11:28:03,674 DEBUG [httpclient.wire.header] >> "Host: [3ffe:ffff:100:f101::1] :8080 [\r] [\n] " 2009-11-16 11:28:03,675 DEBUG [httpclient.wire.header] >> " [\r] [\n] " 2009-11-16 11:28:03,811 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK [\r] [\n] " 2009-11-16 11:28:03,811 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK [\r] [\n] " 2009-11-16 11:28:03,812 DEBUG [httpclient.wire.header] << "Server: Apache-Coyote/1.1 [\r] [\n] " 2009-11-16 11:28:03,812 DEBUG [httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP07 (build: SVNTag=JBPAPP_4_2_0_GA_CP07 date=200911131304)/JBossWeb-2.0 [\r] [\n] " 2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Set-Cookie: JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**; Path=/ [\r] [\n] " 2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " 2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Content-Length: 167 [\r] [\n] " 2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << "Date: Mon, 16 Nov 2009 16:28:03 GMT [\r] [\n] " 2009-11-16 11:28:03,813 DEBUG [httpclient.wire.header] << " [\r] [\n] " 2009-11-16 11:28:03,816 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Cookie accepted: "$Version=0; JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**; $Path=/" 2009-11-16 11:28:03,818 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Buffering response body 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<html> [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<!-- <body bgcolor=blue> --> [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<center> [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << " [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<p>Storing session id in attribute with id: uCtp2TP1sHh5FcMOpnIG5g** [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << " [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "<h1>JBossWeb/2.0.0.GA_CP:8080</h1> [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "</body> [\n] " 2009-11-16 11:28:03,818 DEBUG [httpclient.wire.content] << "</html> [\n] " 2009-11-16 11:28:03,819 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Resorting to protocol version default close connection policy 2009-11-16 11:28:03,819 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Should NOT close connection, using HTTP/1.1 2009-11-16 11:28:03,819 DEBUG [org.apache.commons.httpclient.HttpConnection] Releasing connection back to connection manager. 2009-11-16 11:28:03,827 DEBUG [httpclient.wire.header] >> "GET /http-sr/getattribute.jsp HTTP/1.1 [\r] [\n] " 2009-11-16 11:28:03,827 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Adding Host request header 2009-11-16 11:28:03,827 DEBUG [httpclient.wire.header] >> "User-Agent: Jakarta Commons-HttpClient/3.1 [\r] [\n] " 2009-11-16 11:28:03,827 DEBUG [httpclient.wire.header] >> "Host: [3ffe:ffff:100:f101::1] :8080 [\r] [\n] " 2009-11-16 11:28:03,828 DEBUG [httpclient.wire.header] >> "Cookie: $Version=0; JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g**; $Path=/ [\r] [\n] " 2009-11-16 11:28:03,828 DEBUG [httpclient.wire.header] >> " [\r] [\n] " 2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK [\r] [\n] " 2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "HTTP/1.1 200 OK [\r] [\n] " 2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "Server: Apache-Coyote/1.1 [\r] [\n] " 2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA_CP07 (build: SVNTag=JBPAPP_4_2_0_GA_CP07 date=200911131304)/JBossWeb-2.0 [\r] [\n] " 2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "X-SawTestHttpAttribute: true [\r] [\n] " 2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "X-SessionIsNew: false [\r] [\n] " 2009-11-16 11:28:03,952 DEBUG [httpclient.wire.header] << "Content-Type: text/html;charset=ISO-8859-1 [\r] [\n] " 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.header] << "Content-Length: 122 [\r] [\n] " 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.header] << "Date: Mon, 16 Nov 2009 16:28:03 GMT [\r] [\n] " 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.header] << " [\r] [\n] " 2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Buffering response body 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << " [\n] " 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "<h2>Server info : JBossWeb/2.0.0.GA_CP:8080</h2> [\n] " 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << " [\n] " 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "<p>Retrieve the session id from attribute: [\n] " 2009-11-16 11:28:03,953 DEBUG [httpclient.wire.content] << "uCtp2TP1sHh5FcMOpnIG5g**</p>" 2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Resorting to protocol version default close connection policy 2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpMethodBase] Should NOT close connection, using HTTP/1.1 2009-11-16 11:28:03,953 DEBUG [org.apache.commons.httpclient.HttpConnection] Releasing connection back to connection manager. 2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Client side cookies for server: 3ffe:ffff:100:f101::2 2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : path: / 2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : path specified(by server)?: true 2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : domain: [3ffe:ffff:100:f101::1] 2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : domain specified(by server)?: false 2009-11-16 11:28:04,454 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : expiry: null 2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : external form: JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g** 2009-11-16 11:28:04,456 INFO [org.jboss.test.cluster.test.SimpleTestCase] Saw JSESSIONID=JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g** 2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Client side cookies for server: 3ffe:ffff:100:f101::2 2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : path: / 2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : path specified(by server)?: true 2009-11-16 11:28:04,456 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : domain: 3ffe:ffff:100:f101: 2009-11-16 11:28:04,457 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : domain specified(by server)?: false 2009-11-16 11:28:04,457 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : expiry: null 2009-11-16 11:28:04,457 DEBUG [org.jboss.test.cluster.test.SimpleTestCase] Cookie [0] : external form: JSESSIONID=uCtp2TP1sHh5FcMOpnIG5g** 2009-11-16 11:28:04,457 INFO [org.jboss.test.cluster.test.SimpleTestCase] makeGet(): trying to get from url [3ffe:ffff:100:f101::2] :8080/http-sr/getattribute.jsp" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::2] :8080/http-sr/getattribute.jsp 0. We call the servlet [3ffe:ffff:100:f101::1] :8080/http-sr/testsessionreplication.jsp" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::1] :8080/http-sr/testsessionreplication.jsp 1. When SimpleTestCase calls a session-oriented servlet, the server sends back a cookie but does not set the domain. So the HttpClient sets the domain to the hostname portion of the URL - that is [3ffe:ffff:100:f101::1] 2. When later in the test case, we want to reset the domain to the second server, we call Cookie.setDomain() with the host name of the server 3ffe:ffff:100:f101::1, which differs from the previous call used to set the domain by the brackets 3. When HttpClient sends out the next request [3ffe:ffff:100:f101::2] :8080/http-sr/getattribute.jsp" class="external-link" rel="nofollow">http:// [3ffe:ffff:100:f101::2] :8080/http-sr/getattribute.jsp , it looks for cookies which match the hostname part of the URL [3ffe:ffff:100:f101::1] and does not find any. So no cookies gets attached. In this case, HttpClient needs to be modified not to throw out the cookie (as before) and (ii) we now need to be able to handle server domains for IPv6 literals being set both with and without brackets, somehow. Thinking about it.
          Hide
          Richard Achmatowicz
          added a comment -

          Decided to fix the problem by, in org.apache.commons.httpclient.Cookie.setDomain(String domain), checking for an IPv6 literal address and adding brackets if they are missing. This ensures that cookie matching will work and that we won't have to change any of the test cases.

          Show
          Richard Achmatowicz
          added a comment - Decided to fix the problem by, in org.apache.commons.httpclient.Cookie.setDomain(String domain), checking for an IPv6 literal address and adding brackets if they are missing. This ensures that cookie matching will work and that we won't have to change any of the test cases.
          Hide
          Richard Achmatowicz
          added a comment -

          Attaching patch for commons-httpclient-3.1 and the new patched jar file.

          Show
          Richard Achmatowicz
          added a comment - Attaching patch for commons-httpclient-3.1 and the new patched jar file.
          Hide
          Richard Achmatowicz
          added a comment -

          Attach patch and jar for commons-httpclient version 3.0.1 (compiled with JDK 1.5)

          Show
          Richard Achmatowicz
          added a comment - Attach patch and jar for commons-httpclient version 3.0.1 (compiled with JDK 1.5)
          Hide
          Richard Achmatowicz
          added a comment -

          The patched jars (and related artifacts) have been uploaded to the JBoss buildmagic repository at the locations:
          http://repository.jboss.com/apache-httpclient/3.0.1.patch01/
          http://repository.jboss.com/apache-httpclient/3.1.patch01/

          Test reslults look fine.
          Closing this issue, depite the fact that it will also apply to EAP 5 versions.
          Leaving the related issue JBPAPP-1811 (which specifies EAP 5+) open to track.

          Show
          Richard Achmatowicz
          added a comment - The patched jars (and related artifacts) have been uploaded to the JBoss buildmagic repository at the locations: http://repository.jboss.com/apache-httpclient/3.0.1.patch01/ http://repository.jboss.com/apache-httpclient/3.1.patch01/ Test reslults look fine. Closing this issue, depite the fact that it will also apply to EAP 5 versions. Leaving the related issue JBPAPP-1811 (which specifies EAP 5+) open to track.
          Hide
          Richard Achmatowicz
          added a comment -

          EAP CP branch JBPAPP_4_2_0_GA_CP now incorporates the patched versions of these jars via build-thirdparty.xml.
          This covers both fix versions above.

          Show
          Richard Achmatowicz
          added a comment - EAP CP branch JBPAPP_4_2_0_GA_CP now incorporates the patched versions of these jars via build-thirdparty.xml. This covers both fix versions above.
          Hide
          Brian Stansberry
          added a comment -

          Thanks, Richard!

          Show
          Brian Stansberry
          added a comment - Thanks, Richard!

            People

            • Assignee:
              Brian Stansberry
              Reporter:
              Richard Achmatowicz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: