On 22/03/2024 15:43, Rick Noel wrote:
Mark,

So if my customer object is failing to get set in the session replication,
I could add this to the config snippet?

sessionAttributeNameFilter="customer"

You set that to the attributes you DO want to replicate, not the ones you don't.

Mark


so like this?...........


<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
                                          channelSendOptions="6">

                                   <Manager 
className="org.apache.catalina.ha.session.DeltaManager"
                                            expireSessionsOnShutdown="false"
                                            notifyListenersOnReplication="true"
                                            maxActiveSessions="8192"
                                                               
sessionAttributeNameFilter="customer"
                                            />

                                   <Channel 
className="org.apache.catalina.tribes.group.GroupChannel">
                                     <Membership 
className="org.apache.catalina.tribes.membership.McastService"
                                                 address="228.0.0.4"
                                                 port="45564"
                                                 frequency="500"
                                                 dropTime="3000"/>
                                     <Receiver 
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                                               address="auto"
                                               port="5000"
                                               selectorTimeout="100"
                                               maxThreads="6"/>

                                     <Sender 
className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                                       <Transport 
className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
                                     </Sender>
                                     <Interceptor 
className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
                                     <Interceptor 
className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
                                     <Interceptor 
className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/>
                                   </Channel>

                                   <Valve 
className="org.apache.catalina.ha.tcp.ReplicationValve"
                                          
filter=".*\.gif|.*\.js|.*\.jpeg|.*\.jpg|.*\.png|.*\.htm|.*\.html|.*\.css|.*\.txt"/>


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





Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-----Original Message-----
From: Mark Thomas <ma...@apache.org>
Sent: Friday, March 22, 2024 11:32 AM
To: users@tomcat.apache.org
Subject: [EXT]Re: Tomcat session replication issue - 
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute :

On 22/03/2024 15:15, Rick Noel wrote:
Is there a way to configure DeltaManager or the Cluster element so it does not 
cause my application to throw this error.....

22-Mar-2024 10:56:34.382 SEVERE [http-nio-8586-exec-5] 
org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for 
servlet [jsp] in context with path [##0001] threw exception [An exception 
occurred processing [/services/include/properties.jsp] at line [196]

193:
194:        session.setAttribute( "format", stationFormat );
195:        session.setAttribute( "employee_id", employeeId );
196:        session.setAttribute( "customer", customer );
197:        session.setAttribute( "customer_id", customerId );
198:        session.setAttribute( "nonidentifier_call_letters", 
nonIdentifierCallLetters );
199:        session.setAttribute( "call_letters", callLetters );


Stacktrace:] with root cause
                 java.lang.IllegalArgumentException: setAttribute: 
Non-serializable attribute [customer]


I know why the error, it is because the  customer object was never written to 
be serialiazable.
The old application I am working on has a lot of such non serialized objects 
and I do not want to search out change them all to implement serialiazable

I am hoping there is a way to configure Tomcat to just not try and replication 
sessions all object which are not serialiazable

https://tomcat.apache.org/tomcat-10.1-doc/config/manager.html

Search for sessionAttributeNameFilter

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to