You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Siva Annapareddy <si...@gmail.com> on 2017/01/24 14:50:37 UTC

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?



--
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.

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

Posted by vkulichenko <va...@gmail.com>.
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



--
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-tp10220p10635.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

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

Posted by Siva Annapareddy <si...@gmail.com>.
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



--
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-tp10220p10634.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

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

Posted by Andrey Mashenkov <an...@gmail.com>.
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 <
siva.annapareddy@gmail.com> 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

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

Posted by Siva Annapareddy <si...@gmail.com>.
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.

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

Posted by Siva Annapareddy <si...@gmail.com>.
TTEWebLogWithIgnite.txt
<http://apache-ignite-users.70518.x6.nabble.com/file/n10308/TTEWebLogWithIgnite.txt>  
ignite-config.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/n10308/ignite-config.xml>  


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-tp10220p10308.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

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

Posted by vkulichenko <va...@gmail.com>.
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





--
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-tp10220p10269.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

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

Posted by Siva Annapareddy <si...@gmail.com>.
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] <
ml-node+s70518n10261h53@n6.nabble.com> 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]
> <http:///user/SendEmail.jtp?type=node&node=10261&i=0>> 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.
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Apache-
> Ignite-1-7-0-Session-caching-issue-with-update-session-
> attributes-tp10220p10261.html
> To unsubscribe from Apache Ignite 1.7.0 Session caching issue with update
> session attributes, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=10220&code=c2l2YS5hbm5hcGFyZWRkeUBnbWFpbC5jb218MTAyMjB8MTgyMjEwNzEwNw==>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
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-tp10220p10265.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

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

Posted by Denis Magda <dm...@apache.org>.
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 <si...@gmail.com> 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.


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

Posted by Siva Annapareddy <si...@gmail.com>.
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.

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

Posted by Andrey Gura <ag...@apache.org>.
Use BinaryMarshaller or OptimizedMarshaller with require serializable
flag with false value.

On Tue, Jan 24, 2017 at 5:50 PM, Siva Annapareddy
<si...@gmail.com> 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.