CometD OOrt配置与Tomcat无法正常工作

时间:2013-11-04 10:32:58

标签: java tomcat cometd

我正在使用CometD和Tomcat。我尝试让Oort运行,但似乎2 OORT节点之间的通知存在一些问题。

我尝试了静态但切换到MultiCastConfigServlet以确保我没有犯任何愚蠢的配置错误。

web.xml设置如下:

<servlet>
    <servlet-name>cometd</servlet-name>
    <servlet-class>org.cometd.server.CometdServlet</servlet-class>

    <init-param>
        <param-name>transports</param-name>
        <param-value>org.cometd.server.transport.JSONTransport</param-value>
    </init-param>
    <init-param>
        <param-name>allowedTransports</param-name>
        <param-value>JSONTransport</param-value>
    </init-param>
    <init-param>
        <param-name>timeout</param-name>
        <param-value>10000</param-value>
    </init-param>


    <init-param>
        <param-name>jsonContext</param-name>
        <param-value>org.cometd.server.JacksonJSONContextServer</param-value>
    </init-param>
    <init-param>
        <param-name>maxInterval</param-name>
        <param-value>10000</param-value>
    </init-param>

    <init-param>
        <param-name>long-polling.multiSessionInterval</param-name>
        <param-value>2000</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
</servlet>

<servlet-mapping>
    <servlet-name>cometd</servlet-name>
    <url-pattern>/cometd/*</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>oort</servlet-name>
    <servlet-class>org.cometd.oort.OortMulticastConfigServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    <init-param>
        <param-name>oort.url</param-name>
        <param-value>http://localhost:8080/context/cometd</param-value>
    </init-param>
    <init-param>
        <param-name>oort.channels</param-name>
        <param-value>/appchannel/**,/seti/**</param-value>
    </init-param>
</servlet>

 <servlet>
    <servlet-name>Seti</servlet-name>
    <servlet-class>org.cometd.oort.SetiServlet</servlet-class>
    <load-on-startup>3</load-on-startup>
    <async-supported>true</async-supported>
</servlet>

     <servlet>
    <servlet-name>initializer</servlet-name>
    <servlet-  class>com.company.server.bayeux.BayeuxInitializerServlet</servlet-class>
    <load-on-startup>4</load-on-startup>
    <async-supported>true</async-supported>
</servlet>

我使用seti将用户与会话相关联。此关联必须通过oort与所有oort节点同步。

在我看来,如果新的OOrt节点发挥作用,应该触发Oort.CometListener cometJoined()。但是这个监听器方法永远不会被调用。

我不确定这是tomcat问题还是程序错误。

0 个答案:

没有答案