Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在tomcat 7集群中未正确复制会话属性_Java_Xml_Session_Tomcat_Serialization - Fatal编程技术网

Java 在tomcat 7集群中未正确复制会话属性

Java 在tomcat 7集群中未正确复制会话属性,java,xml,session,tomcat,serialization,Java,Xml,Session,Tomcat,Serialization,我在struts2.3中有以下代码: 现在的问题是,在复制时,DeltaManager能够复制SessionEvent和CustomSessionManager对象,但无法复制用户对象。现在,如果我更改代码序列,并将用户的会话代码放在会话事件之上,则会复制用户对象,但自定义会话管理器不会。不确定这是我的代码中的问题,还是Tomcat7中的增量管理器的行为中存在问题。我也将我的web应用程序标记为。我的tomcat接收器端口也不同。我正在使用粘性会话。以下是群集的server.xml配置 我还在s

我在struts2.3中有以下代码:

现在的问题是,在复制时,DeltaManager能够复制SessionEvent和CustomSessionManager对象,但无法复制用户对象。现在,如果我更改代码序列,并将用户的会话代码放在会话事件之上,则会复制用户对象,但自定义会话管理器不会。不确定这是我的代码中的问题,还是Tomcat7中的增量管理器的行为中存在问题。我也将我的web应用程序标记为。我的tomcat接收器端口也不同。我正在使用粘性会话。以下是群集的server.xml配置 我还在server.xml文件中的引擎标记内指定了jvmRoute属性。我正在使用mod_proxy_平衡器进行负载平衡

  <!--For clustering, please take a look at documentation at:
      /docs/cluster-howto.html  (simple how to)
      /docs/config/cluster.html (reference documentation) -->
  <!--
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
  -->
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" 
                     channelSendOptions="8">



         <Channel className="org.apache.catalina.tribes.group.GroupChannel">

         <Membership className="org.apache.catalina.tribes.membership.McastService"
         address="228.0.0.4"
         port="45569"
         frequency="500"
         dropTime="3000"/>

          <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
         <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
         </Sender>

         <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
         address="auto"
         port="4001"
         autoBind="100"
         selectorTimeout="5000"
         maxThreads="6"/>

         <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=""/>

         <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

         <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>

         <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

</Cluster>

  <!-- Use the LockOutRealm to prevent attempts to guess user passwords
       via a brute-force attack -->
  <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase"/>
  </Realm>

        <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true" deployXML="true">
    <!-- SingleSignOn valve, share authentication between web applications
         Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
         Documentation at: /docs/config/valve.html
         Note: The pattern used is equivalent to using pattern="common" -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="localhost_access_log." suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" />

  </Host>
</Engine>
  <!--For clustering, please take a look at documentation at:
      /docs/cluster-howto.html  (simple how to)
      /docs/config/cluster.html (reference documentation) -->
  <!--
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
  -->
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" 
                     channelSendOptions="8">



         <Channel className="org.apache.catalina.tribes.group.GroupChannel">

         <Membership className="org.apache.catalina.tribes.membership.McastService"
         address="228.0.0.4"
         port="45569"
         frequency="500"
         dropTime="3000"/>

          <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
         <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
         </Sender>

         <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
         address="auto"
         port="4001"
         autoBind="100"
         selectorTimeout="5000"
         maxThreads="6"/>

         <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=""/>

         <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

         <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>

         <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>

</Cluster>

  <!-- Use the LockOutRealm to prevent attempts to guess user passwords
       via a brute-force attack -->
  <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase"/>
  </Realm>

        <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true" deployXML="true">
    <!-- SingleSignOn valve, share authentication between web applications
         Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
         Documentation at: /docs/config/valve.html
         Note: The pattern used is equivalent to using pattern="common" -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="localhost_access_log." suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" />

  </Host>
</Engine>