Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 4.56 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why am I getting multiple-client: true advice from cometd when only 1 client is connected?
  2. Request URL:http://localhost:8080/cometd/handshake
  3. Request Method:POST
  4. Status Code:200 OK
  5.  
  6. Request Headers
  7. Accept:*/*
  8. Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
  9. Accept-Encoding:gzip,deflate,sdch
  10. Accept-Language:en-US,en;q=0.8
  11. Connection:keep-alive
  12. Content-Length:182
  13. Content-Type:application/json;charset=UTF-8
  14. Host:localhost:8080
  15. Origin:http://localhost:8080
  16. Referer:http://localhost:8080/
  17. User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11
  18. X-Requested-With:XMLHttpRequest
  19.  
  20. Request Payload
  21. [{"version":"1.0","minimumVersion":"0.9","channel":"/meta/handshake","supportedConnectionTypes":["long-polling","callback-polling"],"advice":{"timeout":60000,"interval":0},"id":"1"}]
  22.  
  23. Response Headers
  24. Content-Length:201
  25. Content-Type:application/json;charset=UTF-8
  26. Date:Tue, 14 Feb 2012 03:32:24 GMT
  27. Server:Apache-Coyote/1.1
  28. Set-Cookie:BAYEUX_BROWSER=dac8yl3vlli7s8x2gymdm2ca177s; Path=/
  29.        
  30. [{"id":"1","minimumVersion":"1.0","supportedConnectionTypes":["callback-polling","long-polling"],"successful":true,"channel":"/meta/handshake","clientId":"115v93y19uvavr159qvzz43yct1","version":"1.0"}]
  31.        
  32. Request URL:http://localhost:8080/cometd/connect
  33. Request Method:POST
  34. Status Code:200 OK
  35.  
  36. Request Headers
  37. Accept:*/*
  38. Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
  39. Accept-Encoding:gzip,deflate,sdch
  40. Accept-Language:en-US,en;q=0.8
  41. Connection:keep-alive
  42. Content-Length:134
  43. Content-Type:application/json;charset=UTF-8
  44. Cookie:BAYEUX_BROWSER=dac8yl3vlli7s8x2gymdm2ca177s
  45. Host:localhost:8080
  46. Origin:http://localhost:8080
  47. Referer:http://localhost:8080/
  48. User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11
  49. X-Requested-With:XMLHttpRequest
  50.  
  51. Request Payload
  52. [{"channel":"/meta/connect","connectionType":"long-polling","advice":{"timeout":0},"id":"2","clientId":"115v93y19uvavr159qvzz43yct1"}]
  53.  
  54. Response Headers
  55. Content-Length:116
  56. Content-Type:application/json;charset=UTF-8
  57. Date:Tue, 14 Feb 2012 03:32:24 GMT
  58. Server:Apache-Coyote/1.1
  59.        
  60. [{"id":"2","successful":true,"advice":{"interval":0,"reconnect":"retry","timeout":30000},"channel":"/meta/connect"}]
  61.        
  62. [{"id":"3","successful":true,"channel":"/meta/connect"}]
  63.        
  64. [{"id":"4","successful":true,"advice":{"interval":2000,"reconnect":"retry","multiple-clients":true},"channel":"/meta/connect"}]
  65.        
  66. <web-app xmlns="http://java.sun.com/xml/ns/javaee" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  67. ...
  68. <servlet>
  69.     <servlet-name>cometd</servlet-name>
  70.     <servlet-class>org.cometd.server.CometdServlet</servlet-class>
  71.     <load-on-startup>1</load-on-startup>
  72.     <async-supported>true</async-supported>
  73.     <init-param>
  74.         <param-name>timeout</param-name>
  75.         <param-value>30000</param-value>
  76.     </init-param>
  77.     <init-param>
  78.         <param-name>logLevel</param-name>
  79.         <param-value>3</param-value>
  80.     </init-param>
  81. </servlet>
  82. ...
  83. <servlet-name>cometd</servlet-name>
  84.     <url-pattern>/cometd/*</url-pattern>
  85. </servlet-mapping>
  86. ...
  87. </web-app>
  88.        
  89. grails.project.class.dir = "target/classes"
  90. grails.project.test.class.dir = "target/test-classes"
  91. grails.project.test.reports.dir = "target/test-reports"
  92. grails.project.target.level = 1.6
  93.  
  94. grails.project.dependency.resolution = {
  95.     // inherit Grails' default dependencies
  96.     inherits "global"
  97.     log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
  98.     repositories {
  99.         mavenCentral()
  100.     }
  101.     dependencies {
  102.  
  103.         def cometVersion = '2.4.0'
  104.  
  105.         compile(group: 'org.cometd.java', name: 'cometd-java-server', version: cometVersion) {
  106.             excludes 'servlet-api'
  107.         }
  108.         compile group: 'org.cometd.java', name: 'bayeux-api', version: cometVersion
  109.         runtime group: 'org.eclipse.jetty', name: 'jetty-servlets', version: '7.6.0.v20120127'
  110.         test group: 'org.cometd.java', name: 'cometd-java-client', version: cometVersion        
  111.     }
  112.  
  113.     plugins {
  114.         build(":tomcat:$grailsVersion",
  115.             ":release:1.0.0") {
  116.             export = false
  117.         }
  118.     }
  119. }
  120.        
  121. def doWithSpring = {
  122.  
  123.     bayeux(BayeuxServerImpl) { bean ->
  124.         bean.initMethod = 'start'
  125.         bean.destroyMethod = 'stop'
  126.     }
  127.  
  128.     // the CometdServlet will pick up the Bayeux object from the servlet context
  129.     bayeuxAttributeExporter(ServletContextAttributeExporter) {
  130.         attributes = [(BayeuxServer.ATTRIBUTE): ref('bayeux')]
  131.     }        
  132. }