pizan5566
隔夜的果酱_5566
采纳率100%
2015-09-18 15:25 阅读 4.0k
已采纳

apache tomcat集群Session 共享后报错!

10

我参考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条回答 默认 最新

  • 已采纳
    pizan5566 隔夜的果酱_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>
    

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

    点赞 1 评论 复制链接分享
  • devmiao devmiao 2015-09-18 15:28
    点赞 1 评论 复制链接分享
  • pizan5566 隔夜的果酱_5566 2015-09-18 15:45
    点赞 评论 复制链接分享
  • k_huang k_huang 2021-01-22 17:09

     org.apache.catalina.ha.session.DeltaManager messageReceived
    严重: Manager [localhost#]: Unable to receive message through TCP channel
    java.lang.ClassNotFoundException: org.eredlab.g4.rif.web.CommonActionForm
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:247)
            at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603)
            at org.apache.catalina.tribes.io.ReplicationStream.resolveClass(ReplicationStream.java:78)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
            at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.readExternal(DeltaRequest.java:376)
            at org.apache.catalina.ha.session.DeltaRequest.readExternal(DeltaRequest.java:270)
            at org.apache.catalina.ha.session.DeltaManager.deserializeDeltaRequest(DeltaManager.java:723)
            at org.apache.catalina.ha.session.DeltaManager.handleSESSION_DELTA(DeltaManager.java:1542)
            at org.apache.catalina.ha.session.DeltaManager.messageReceived(DeltaManager.java:1489)
            at org.apache.catalina.ha.session.DeltaManager.messageDataReceived(DeltaManager.java:1202)
            at org.apache.catalina.ha.session.ClusterSessionListener.messageReceived(ClusterSessionListener.java:92)
            at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:901)
            at org.apache.catalina.ha.tcp.SimpleTcpCluster.messageReceived(SimpleTcpCluster.java:882)
            at org.apache.catalina.tribes.group.GroupChannel.messageReceived(GroupChannel.java:269)
            at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
            at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
            at org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.messageReceived(TcpFailureDetector.java:110)
            at org.apache.catalina.tribes.group.ChannelInterceptorBase.messageReceived(ChannelInterceptorBase.java:79)
            at org.apache.catalina.tribes.group.ChannelCoordinator.messageReceived(ChannelCoordinator.java:241)
            at org.apache.catalina.tribes.transport.ReceiverBase.messageDataReceived(ReceiverBase.java:225)
            at org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel(NioReplicationTask.java:188)
            at org.apache.catalina.tribes.transport.nio.NioReplicationTask.run(NioReplicationTask.java:91)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:662)
            
            
     

    点赞 评论 复制链接分享
  • k_huang k_huang 2021-01-22 17:09

    怎么解决这个问题呢

     

    点赞 评论 复制链接分享

相关推荐