Apache Ignite 1.7.0 Session caching issue with update session attributes

classic Classic list List threaded Threaded
10 messages Options
Siva Annapareddy Siva Annapareddy
Reply | Threaded
Open this post in threaded view
|

Apache Ignite 1.7.0 Session caching issue with update session attributes

While trying Appache Ignite 1.7.0 for Web Session Caching for a Groovy Application, we seem to have hit issue with
'Failed to unmarshal object with optimized marshaller'  
or
'Failed to serialize object: <App Object with Java Serializable>' with JdkMarshaller that points to 'Caused by: java.io.NotSerializableException: groovy.json.internal.LazyMap'

Application is running in GGTS on Windows Platform and Apache Ignite 1.7.0 two-node cluster running on RHEL 7

Any clues on how to proceed?
agura agura
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

Use BinaryMarshaller or OptimizedMarshaller with require serializable
flag with false value.

On Tue, Jan 24, 2017 at 5:50 PM, Siva Annapareddy
<[hidden email]> wrote:

> While trying Appache Ignite 1.7.0 for Web Session Caching for a Groovy
> Application, we seem to have hit issue with
> 'Failed to unmarshal object with optimized marshaller'
> or
> 'Failed to serialize object: <App Object with Java Serializable>' with
> JdkMarshaller that points to 'Caused by: java.io.NotSerializableException:
> groovy.json.internal.LazyMap'
>
> Application is running in GGTS on Windows Platform and Apache Ignite 1.7.0
> two-node cluster running on RHEL 7
>
> Any clues on how to proceed?
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Apache-Ignite-1-7-0-Session-caching-issue-with-update-session-attributes-tp10220.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Siva Annapareddy Siva Annapareddy
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

Since OptimizedMarshaller is default we have run into issues:

End of stream reached: java.io.ByteArrayInputStream@438f0960. Stacktrace follows:
Message: Failed to unmarshal object with optimized marshaller

Hence, tried with jdkmarshaller and ran into Object Not Serializable

We understand that Groovy 2.5.4 the default underlying Map  is LazyMap and that is not Serializable.

We did not find org.apache.ignite.marshaller.binary.BinaryMarshaller in Ignite 1.7.0. Am I missing something?
Denis Magda-2 Denis Magda-2
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

Binary Marshaller is used by default. So, don’t override marshaller in your configuration.

By the why are you trying to serialize this LazyMap? How does Ignite code look like?

-
Denis

> On Jan 26, 2017, at 6:57 AM, Siva Annapareddy <[hidden email]> wrote:
>
> Since OptimizedMarshaller is default we have run into issues:
>
> End of stream reached: java.io.ByteArrayInputStream@438f0960. Stacktrace
> follows:
> Message: Failed to unmarshal object with optimized marshaller
>
> Hence, tried with jdkmarshaller and ran into Object Not Serializable
>
> We understand that Groovy 2.5.4 the default underlying Map  is LazyMap and
> that is not Serializable.
>
> We did not find org.apache.ignite.marshaller.binary.BinaryMarshaller in
> Ignite 1.7.0. Am I missing something?
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Apache-Ignite-1-7-0-Session-caching-issue-with-update-session-attributes-tp10220p10257.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Siva Annapareddy Siva Annapareddy
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

We were using default set up for Web Sessions caching in Groovy Application. No specific Ignite code except reading default-config.xml that specifies :
Cache Name
Ignite Cluster IP Addresses to be discovered

Under Spring Security A session created is cached in Ignite JVMs. After Authentication, a new session is created and Session gets updated. During Session update, Application puts some Groovy objects in Session Object. Groovy Object contains fields without types specified. Some of the types seemed to have been implemented as LazyMap that is not serializable. Hence the Session stored on Ignite JVMs are not updated. Next time Application references the Session, it would not find necessary data in the Session retrived from Ignite JVMs



On Thu, Jan 26, 2017 at 1:00 PM, Denis Magda-2 [via Apache Ignite Users] <[hidden email]> wrote:
Binary Marshaller is used by default. So, don’t override marshaller in your configuration.

By the why are you trying to serialize this LazyMap? How does Ignite code look like?

-
Denis

> On Jan 26, 2017, at 6:57 AM, Siva Annapareddy <[hidden email]> wrote:
>
> Since OptimizedMarshaller is default we have run into issues:
>
> End of stream reached: java.io.ByteArrayInputStream@438f0960. Stacktrace
> follows:
> Message: Failed to unmarshal object with optimized marshaller
>
> Hence, tried with jdkmarshaller and ran into Object Not Serializable
>
> We understand that Groovy 2.5.4 the default underlying Map  is LazyMap and
> that is not Serializable.
>
> We did not find org.apache.ignite.marshaller.binary.BinaryMarshaller in
> Ignite 1.7.0. Am I missing something?
>
>
>
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Apache-Ignite-1-7-0-Session-caching-issue-with-update-session-attributes-tp10220p10257.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.




To unsubscribe from Apache Ignite 1.7.0 Session caching issue with update session attributes, click here.
NAML

vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

Binary marshaller is default internal format, there is no need to set it explicitly in configuration. If you remove the 'marshaller' property from configuration, it will be used. If it doesn't work this way as well, please attach configuration and the exception trace.

-Val

Siva Annapareddy Siva Annapareddy
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

ignite-config.xml

TTEWebLogWithIgnite.txt


Uploaded config file and logs from my Groovy Web Application
Config file is same on Apache Ingnite 2-node cluster except for the line:
   <property name="clientMode" value="true"/>
Andrew Mashenkov Andrew Mashenkov
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

Hi Siva,

It look like you are trying to deserialize org.codehaus.groovy.grails.web.util.StreamCharBuffer object using Externalizable interface.
Possibly, you save to session non-static nested object or anonymous class object that has implicit link to its parent.

According javadoc to StreamCharBuffer - Grails GSP rendering uses this class as a buffer that is optimized for performance. 
Is it possible you save some object that class declared in GSP file?

Also I'm confused, that optimized marshaller is used, If there is a chance that there is some old data in cache, that was created by optimized marshaller?

On Mon, Jan 30, 2017 at 3:54 PM, Siva Annapareddy <[hidden email]> wrote:
ignite-config.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/n10309/ignite-config.xml>

TTEWebLogWithIgnite.txt
<http://apache-ignite-users.70518.x6.nabble.com/file/n10309/TTEWebLogWithIgnite.txt>


Uploaded config file and logs from my Groovy Web Application
Config file is same on Apache Ingnite 2-node cluster except for the line:
   <property name="clientMode" value="true"/>



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Apache-Ignite-1-7-0-Session-caching-issue-with-update-session-attributes-tp10220p10309.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.



--
С уважением,
Машенков Андрей Владимирович
Тел. +7-921-932-61-82

Best regards,
Andrey V. Mashenkov
Cerr: +7-921-932-61-82
Regards, Andrew.
Siva Annapareddy Siva Annapareddy
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

A crude solution is to use jdkmarshaller with <property name="peerClassLoadingEnabled" value="true"/>  to identify all the LazyMap objects included in the objects that are saved in session object. And change the code to convert all the LazyMap objects to HashMap objects before saving to the session object

This has worked

Still Looking for an elegant solution

Thanks for your time
vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: Apache Ignite 1.7.0 Session caching issue with update session attributes

I don't think there is more elegant solution in case you're using JdkMarshaller. Enabling web session clustering is not always completely transparent as you switch from local storage to distributed storage. With JDK serialization it's required that all serialized classes implement Serializable. However, as mentioned above, you should not have this issue with BinaryMarshaller.

-Val