隔夜的果酱_5566 2015-09-18 15:25 采纳率: 100%
浏览 4139
已采纳

apache tomcat集群Session 共享后报错!

我参考http://www.blogjava.net/killme2008/archive/2007/03/13/103607.html 实现session共享。
然后我把我的工程放到tomcat 里面去。启动不报错。点击登录的时候就登录不进去。多次点击登录按钮
会进入到主界面然后又强制退出到登录界面。
我的tomcat集群版本是
Apache 2.2.25
Tomcat-7.0.55

点击登录的时候报:
严重: Manager [localhost#/MesLLong]: Unable to receive message through TCP channel
java.lang.IllegalArgumentException: Session id mismatch, not executing the delta request
at org.apache.catalina.ha.session.DeltaRequest.execute(DeltaRequest.java:160)
at org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1280)
at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1226)
at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:944)
at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:9
1)
at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:936)
at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:917)
at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:278)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java
:82)
at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector
.java:117)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java
:82)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java
:82)
at org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.messageReceived(ThroughputInter
ceptor.java:90)
at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java
:82)
at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:252)
at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:287)
at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:21
0)
at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:99)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)。
拜托各位大神指教!

  • 写回答

5条回答 默认 最新

  • 隔夜的果酱_5566 2015-09-21 01:51
    关注

    经过这几天的网上查找资料。问题终于解决。原来是我在tomcat中server.xml中中的值设置错误。替换代码如下

     <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
        channelSendOptions="8">
        <Manager className="org.apache.catalina.ha.session.DeltaManager"
            expireSessionsOnShutdown="false" notifyListenersOnReplication="true" />
        <Channel className="org.apache.catalina.tribes.group.GroupChannel">
            <Membership className="org.apache.catalina.tribes.membership.McastService"
                address="228.0.0.10" port="45564" frequency="500" dropTime="3000" />
            <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                address="auto" port="4000" autoBind="100" selectorTimeout="5000"
                maxThreads="6" />
            <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                <Transport
                    className="org.apache.catalina.tribes.transport.nio.PooledParallelSender" timeout="30000" />
            </Sender>
            <Interceptor
                className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" />
                <Interceptor
                className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor" />
        </Channel>
        <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
            filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.css;.*\.txt;" />
        <ClusterListener
            className="org.apache.catalina.ha.session.ClusterSessionListener" />
    </Cluster>
    

    修改后启动。成功实现功能操作!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 QTOF MSE数据分析
  • ¥15 平板录音机录音问题解决
  • ¥15 请问维特智能的安卓APP在手机上存储传感器数据后,如何找到它的存储路径?
  • ¥15 (SQL语句|查询结果翻了4倍)
  • ¥15 Odoo17操作下面代码的模块时出现没有'读取'来访问
  • ¥50 .net core 并发调用接口问题
  • ¥15 网上各种方法试过了,pip还是无法使用
  • ¥15 用verilog实现tanh函数和softplus函数
  • ¥15 Hadoop集群部署启动Hadoop时碰到问题
  • ¥15 求京东批量付款能替代天诚