Tomcat 8.5.4, Backup Manager and Serializable objects in httpSession

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Tomcat 8.5.4, Backup Manager and Serializable objects in httpSession

Jared Walker
Hello,

I have a question about how BackupManager enforces or performs session
replication.

I have added print outs to the serializing methods of an object I'm
binding to the http session.  When I run a simple test (login to the
server, shut it down, then try to refresh) I do not stay logged in.
In looking through my debug output I have noticed the following on the
server that is acting as the backup for session replication:

ClickSession:865 - Session read in:
ClickSession:866 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
ClickSession:867 - Login ID: 1
1249:ClickSession is bound to HttpSession tj8Zu6ANdJdftMJHPAOa/JyTBiY=
by key com.clickfind.http.ClickSession

ClickSession:865 - Session read in:
ClickSession:866 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
ClickSession:867 - Login ID: 18201

ClickSession:865 - Session read in:
ClickSession:866 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
ClickSession:867 - Login ID: 18201

ClickSession:876 - Session write out:
ClickSession:877 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
ClickSession:878 - Login ID: 1

As you can see, initially the session is replicated across with a
guest login (ID=1).  Then there are subsequent messages that indicate
it is receiving updates to the session with an actual login value
(ID=18201).

However, when it goes to replicate the session to another server
(because the primary node was shut down) you can see that it writes
out the original value for the session (ID=1).

How can I ensure that the replication replaces the existing object in
the session attributes?

Thanks,
-Jared

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tomcat 8.5.4, Backup Manager and Serializable objects in httpSession

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jared,

On 5/29/17 5:03 PM, Jared Walker wrote:

> Hello,
>
> I have a question about how BackupManager enforces or performs
> session replication.
>
> I have added print outs to the serializing methods of an object
> I'm binding to the http session.  When I run a simple test (login
> to the server, shut it down, then try to refresh) I do not stay
> logged in. In looking through my debug output I have noticed the
> following on the server that is acting as the backup for session
> replication:
>
> ClickSession:865 - Session read in: ClickSession:866 - Session ID:
> tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 - Login ID: 1
> 1249:ClickSession is bound to HttpSession
> tj8Zu6ANdJdftMJHPAOa/JyTBiY= by key
> com.clickfind.http.ClickSession
>
> ClickSession:865 - Session read in: ClickSession:866 - Session ID:
> tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 - Login ID: 18201
>
> ClickSession:865 - Session read in: ClickSession:866 - Session ID:
> tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 - Login ID: 18201
>
> ClickSession:876 - Session write out: ClickSession:877 - Session
> ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:878 - Login ID: 1
>
> As you can see, initially the session is replicated across with a
> guest login (ID=1).  Then there are subsequent messages that
> indicate it is receiving updates to the session with an actual
> login value (ID=18201).
>
> However, when it goes to replicate the session to another server
> (because the primary node was shut down) you can see that it
> writes out the original value for the session (ID=1).
>
> How can I ensure that the replication replaces the existing object
> in the session attributes?

Can you post the code that generates the above output?

Are all those messages printed on the backup node (only)? Give us a
little more information about the setup of your cluster.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZLZAqAAoJEBzwKT+lPKRYiaAP/2rf2SnGTDeSbGcQPGVUqiJW
RIOYQcFITI9NC7kimSJGzgpwOa0kC4QAB5VDMhm7Jxgk+f+JercgEWgauWb8gxGy
QV5UHDRdAv1oD5/17hS0tSnIVt7hq2+Ar181BGMV29JyLMCnvimOdyklMmGRV/ET
aS9V32ybE49oIZkdUU7bybYIR3hBn+1wPn2P+/8S0tw0CN1L4+LI7u/RZXAU4pua
U5gPUBz5N+T57txnEvd1yfGdLuZqoeWiS7VYOo2pRwtilYkYbzCh0SlDU5WPgbX/
TFG3J2sukEilcz4k1MWxzRiiyjo1JuhhfqB2vx3QJsxDoceKK5yaquwbscieYIFN
ONJMez0v1REDJ5C5d0gK/KdgU2PuNRwwgNiW3AO/nMUawGwdVGAL1UySzBcBs6Yd
WCwoCrwG97mSw2XKP0ioCvVQeWARfZ9ZL2DXKjJDQoghlSzsJGk5jFz8+yJYELzR
EKWlHvStwxaqBxQhqC/3SptMUlH2BKLHwro9uWulh0n0Y0Ii9wDRC0B6HqIg99pI
Ghn0lUevGEV0k4UsEzfUoVCi9CWxhixYijx5ZMCM88jlek8dl/UF2Rp5ZC3+scoY
zsGU6u9qaiW6VQrCcvkDA2GURuXuRoELsz0YdnVglEIQ9fQhs2UTUhSu5WJdltSw
h2cgi4lJG+lJq+nInDbx
=VJNr
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tomcat 8.5.4, Backup Manager and Serializable objects in httpSession

Jared Walker
Hello,

I was able to figure out that this issue was caused by a developer
adding logging code to the serialization that had a NPE.
Unfortunately the exception was not printed out to catalina.out so it
was very hard to find, but easy to fix.


Thanks,
-Jared

On Tue, May 30, 2017 at 10:30 AM, Christopher Schultz
<[hidden email]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Jared,
>
> On 5/29/17 5:03 PM, Jared Walker wrote:
>> Hello,
>>
>> I have a question about how BackupManager enforces or performs
>> session replication.
>>
>> I have added print outs to the serializing methods of an object
>> I'm binding to the http session.  When I run a simple test (login
>> to the server, shut it down, then try to refresh) I do not stay
>> logged in. In looking through my debug output I have noticed the
>> following on the server that is acting as the backup for session
>> replication:
>>
>> ClickSession:865 - Session read in: ClickSession:866 - Session ID:
>> tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 - Login ID: 1
>> 1249:ClickSession is bound to HttpSession
>> tj8Zu6ANdJdftMJHPAOa/JyTBiY= by key
>> com.clickfind.http.ClickSession
>>
>> ClickSession:865 - Session read in: ClickSession:866 - Session ID:
>> tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 - Login ID: 18201
>>
>> ClickSession:865 - Session read in: ClickSession:866 - Session ID:
>> tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 - Login ID: 18201
>>
>> ClickSession:876 - Session write out: ClickSession:877 - Session
>> ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:878 - Login ID: 1
>>
>> As you can see, initially the session is replicated across with a
>> guest login (ID=1).  Then there are subsequent messages that
>> indicate it is receiving updates to the session with an actual
>> login value (ID=18201).
>>
>> However, when it goes to replicate the session to another server
>> (because the primary node was shut down) you can see that it
>> writes out the original value for the session (ID=1).
>>
>> How can I ensure that the replication replaces the existing object
>> in the session attributes?
>
> Can you post the code that generates the above output?
>
> Are all those messages printed on the backup node (only)? Give us a
> little more information about the setup of your cluster.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJZLZAqAAoJEBzwKT+lPKRYiaAP/2rf2SnGTDeSbGcQPGVUqiJW
> RIOYQcFITI9NC7kimSJGzgpwOa0kC4QAB5VDMhm7Jxgk+f+JercgEWgauWb8gxGy
> QV5UHDRdAv1oD5/17hS0tSnIVt7hq2+Ar181BGMV29JyLMCnvimOdyklMmGRV/ET
> aS9V32ybE49oIZkdUU7bybYIR3hBn+1wPn2P+/8S0tw0CN1L4+LI7u/RZXAU4pua
> U5gPUBz5N+T57txnEvd1yfGdLuZqoeWiS7VYOo2pRwtilYkYbzCh0SlDU5WPgbX/
> TFG3J2sukEilcz4k1MWxzRiiyjo1JuhhfqB2vx3QJsxDoceKK5yaquwbscieYIFN
> ONJMez0v1REDJ5C5d0gK/KdgU2PuNRwwgNiW3AO/nMUawGwdVGAL1UySzBcBs6Yd
> WCwoCrwG97mSw2XKP0ioCvVQeWARfZ9ZL2DXKjJDQoghlSzsJGk5jFz8+yJYELzR
> EKWlHvStwxaqBxQhqC/3SptMUlH2BKLHwro9uWulh0n0Y0Ii9wDRC0B6HqIg99pI
> Ghn0lUevGEV0k4UsEzfUoVCi9CWxhixYijx5ZMCM88jlek8dl/UF2Rp5ZC3+scoY
> zsGU6u9qaiW6VQrCcvkDA2GURuXuRoELsz0YdnVglEIQ9fQhs2UTUhSu5WJdltSw
> h2cgi4lJG+lJq+nInDbx
> =VJNr
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tomcat 8.5.4, Backup Manager and Serializable objects in httpSession

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jared,

On 6/4/17 7:45 PM, Jared Walker wrote:
> I was able to figure out that this issue was caused by a developer
> adding logging code to the serialization that had a NPE.
> Unfortunately the exception was not printed out to catalina.out so
> it was very hard to find, but easy to fix.

Was Tomcat swallowing the NPE? If so, please let me know where that
happened. I've seen a few exception-swallowing pieces of Tomcat code,
and I've been wanting to at least log those instances.

- -chris

> On Tue, May 30, 2017 at 10:30 AM, Christopher Schultz
> <[hidden email]> wrote: Jared,
>
> On 5/29/17 5:03 PM, Jared Walker wrote:
>>>> Hello,
>>>>
>>>> I have a question about how BackupManager enforces or
>>>> performs session replication.
>>>>
>>>> I have added print outs to the serializing methods of an
>>>> object I'm binding to the http session.  When I run a simple
>>>> test (login to the server, shut it down, then try to refresh)
>>>> I do not stay logged in. In looking through my debug output I
>>>> have noticed the following on the server that is acting as
>>>> the backup for session replication:
>>>>
>>>> ClickSession:865 - Session read in: ClickSession:866 -
>>>> Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 -
>>>> Login ID: 1 1249:ClickSession is bound to HttpSession
>>>> tj8Zu6ANdJdftMJHPAOa/JyTBiY= by key
>>>> com.clickfind.http.ClickSession
>>>>
>>>> ClickSession:865 - Session read in: ClickSession:866 -
>>>> Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 -
>>>> Login ID: 18201
>>>>
>>>> ClickSession:865 - Session read in: ClickSession:866 -
>>>> Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:867 -
>>>> Login ID: 18201
>>>>
>>>> ClickSession:876 - Session write out: ClickSession:877 -
>>>> Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY= ClickSession:878 -
>>>> Login ID: 1
>>>>
>>>> As you can see, initially the session is replicated across
>>>> with a guest login (ID=1).  Then there are subsequent
>>>> messages that indicate it is receiving updates to the session
>>>> with an actual login value (ID=18201).
>>>>
>>>> However, when it goes to replicate the session to another
>>>> server (because the primary node was shut down) you can see
>>>> that it writes out the original value for the session
>>>> (ID=1).
>>>>
>>>> How can I ensure that the replication replaces the existing
>>>> object in the session attributes?
>
> Can you post the code that generates the above output?
>
> Are all those messages printed on the backup node (only)? Give us
> a little more information about the setup of your cluster.
>
> -chris
>>
>> ---------------------------------------------------------------------
>>
>>
To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
>
>
To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZNXFaAAoJEBzwKT+lPKRYnQcP/AqCnHAMpWbi34hjXnxOxlSN
Loq7fC7yLdOgD/KWtJgYLyh4Jz0rcdEo+fQcmTtVBNVcQBkXqWMVlVw4oOegtOYB
3Hg6CmmH5LxymUb9/HE82l9hhcSc5fdzZyVqEjaBNUsN06PEiuDgswWiOAHlnut7
X0kaokZwyO524oz3RhwLlC4iZA1bvBFpiyI9/xBM2Ur2NpgbEMXK8WSiE9LHQb92
QgmhZlUaZw4pONzBhv3vQluV2P/rCQkcqfgizZFRFmv//A51FjsxqbZ5qniU8B+v
fUtNRIH2yMN43tM8US2NkwsqLOynsK6HXEg3581jK4zC79N8NOsOZKcNpOdbIU/t
W7tkqtAmLa0KGz4/iWM0AIe6rQmrJ2iA3lnye8ZAL8n+gtnTW4BnePEBRYwpYzuQ
pXEFJuAkH0skTHgYwVe0DQEN6pzj1EQUEnydAA8j0/9T7v4QVFswUF+9gbCBo1QG
EoRckSZIRuj+QSV/6aNiJPXWpuAsr/DXho9rjBqkAch71Z0XUQXz7dnhrLipBc05
gek54XvFv0Z1o/cK4gqT/7fkJLlWjOV1WtObwzRY4w2vVlMNzsmlMxYRlUCJbW67
IXUOnH/fAYepxuqN3WwpL98vtzvSIDZHUTdeDABB5JVLmTVTc51QICTFSMY+6aQD
dZI6oDm2jdz2j6D10OMx
=z5QC
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Tomcat 8.5.4, Backup Manager and Serializable objects in httpSession

Jared Walker
In reply to this post by Jared Walker
Hello,

The exception was not swallowed. It was just in a different log file
which I wasn't anticipating.

Thanks,
-Jared

On Mon, May 29, 2017 at 4:03 PM, Jared Walker
<[hidden email]> wrote:

> Hello,
>
> I have a question about how BackupManager enforces or performs session
> replication.
>
> I have added print outs to the serializing methods of an object I'm
> binding to the http session.  When I run a simple test (login to the
> server, shut it down, then try to refresh) I do not stay logged in.
> In looking through my debug output I have noticed the following on the
> server that is acting as the backup for session replication:
>
> ClickSession:865 - Session read in:
> ClickSession:866 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
> ClickSession:867 - Login ID: 1
> 1249:ClickSession is bound to HttpSession tj8Zu6ANdJdftMJHPAOa/JyTBiY=
> by key com.clickfind.http.ClickSession
>
> ClickSession:865 - Session read in:
> ClickSession:866 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
> ClickSession:867 - Login ID: 18201
>
> ClickSession:865 - Session read in:
> ClickSession:866 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
> ClickSession:867 - Login ID: 18201
>
> ClickSession:876 - Session write out:
> ClickSession:877 - Session ID: tj8Zu6ANdJdftMJHPAOa/JyTBiY=
> ClickSession:878 - Login ID: 1
>
> As you can see, initially the session is replicated across with a
> guest login (ID=1).  Then there are subsequent messages that indicate
> it is receiving updates to the session with an actual login value
> (ID=18201).
>
> However, when it goes to replicate the session to another server
> (because the primary node was shut down) you can see that it writes
> out the original value for the session (ID=1).
>
> How can I ensure that the replication replaces the existing object in
> the session attributes?
>
> Thanks,
> -Jared

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]