Using msm with Zk framework v5

257 views
Skip to first unread message

Sergio

unread,
Dec 17, 2013, 4:37:08 PM12/17/13
to memcached-se...@googlegroups.com
Hi Martin

This last days, I've been dealing with memcached and msm trying to get a Tomcat session replication. But I found a problem, I'm deploying on Tomcat 7 an app is using ZK framework (v5) and I'm getting the next error:

Couple days ago I asked for this issue in the official ZK forums, but I didn't get any response about it.

I don't put here a lot of details about the app, because there are legal restrictions. I just have to say that it is a critical task right now.

I'm trying to use msm for non sticky sessions, I've been reading through this list a lot of entries but when I think that I'm close to success, just I have another kind of error.

I have Windows 7 like host SO and Linux Centos 6.4 like guest SO. Both have Tomcat 7. 

Right now, I have the next tomcat 7 configuration on Windows:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:centos-on-virtualbox-ip:11211"
failoverNodes="n1"
   requestUriIgnorePattern=".*\.(png|gif|jpg|css|js|ico)$"
   sessionBackupAsync="false"
   sessionBackupTimeout="100"
            transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
            customConverter="de.javakaffee.web.msm.serializer.kryo.JodaDateTimeRegistration,de.javakaffee.web.msm.serializer.kryo.WicketSerializerFactory" />

Right now, I have the next tomcat 7 configuration on Centos:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
   memcachedNodes="n1:centos-on-virtualbox-ip:11211"
   sticky="false"
   sessionBackupAsync="true"
   requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
   transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" />

In centos I have the next log output:

de.javakaffee.web.msm.LockingStrategy pingSession
WARNING: The session 64A4318C9F84A00539ADC6AFCE5B84A0-n1 should be touched in memcached, but it does not exist therein.
Dec 17, 2013 3:22:25 PM de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
WARNING: Could not load session with id 64A4318C9F84A00539ADC6AFCE5B84A0-n1 from memcached.
java.lang.RuntimeException: The loaded object for sessionId 64A4318C9F84A00539ADC6AFCE5B84A0-n1 is not of required type byte[], but java.lang.Integer

But sometimes, I have the next behavior:

When I trigger some events on ZK elements (just like click on radio options, click on buttons, on blur, etc), just like all times ZK makes a request to the server, then I get an alert window with the next message: "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier." with the buttons "resend" and "cancel". When I look the Id session with firebug, I find that the all sessions id are differents between them.


But in Windows, I have next log output:

SEVERE [org.apache.catalina.session.StandardManager] - Excepción loading sessions persistent store; Caused by: org.zkoss.zk.ui.UiException: SpringUtil can be called only under ZK environment!

Memcached is installed and running in Centos. Both SO are seeing between them currently (I've tested with telnet and ping, and doing request from Centos to Tomcat installed in Windows and viceversa).

In the app, I have the next maven dependencies:

                <dependency>
   <groupId>de.javakaffee.msm</groupId>
   <artifactId>msm-kryo-serializer</artifactId>
   <version>1.6.5</version>
   <scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.spy</groupId>
<artifactId>spymemcached</artifactId>
<version>2.10.3</version>
</dependency>

In the $CATALINA_HOME/lib directory, I have the next related jars:

asm-3.2, commons-codec-1.5, kryo-1.04, kryo-serializers-0.10, memcached-session-manager-1.6.5, memcached-session-manager-tc7-1.6.5, minlog-1.2, msm-kryo-serializer-1.6.5, netty-3.5.5.Final, reflectasm-1.01, spymemcached-2.10.3


could you help me to fix this trouble?
do you know how I can to deal with this kind of trouble?

Martin Grotzke

unread,
Dec 18, 2013, 4:37:02 PM12/18/13
to memcached-se...@googlegroups.com
Hi,

On 12/17/2013 10:37 PM, Sergio wrote:
>
> I'm trying to use msm for *non sticky sessions*, I've been reading
> through this list a lot of entries but when I think that I'm close to
> success, just I have another kind of error.
>
> I have Windows 7 like host SO and Linux Centos 6.4 like guest SO. Both
> have Tomcat 7.

What does "SO" mean? What is the relationship of the windows and linux
hosts, what are their roles?


> Right now, I have the next tomcat 7 configuration on Windows:
>
> <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
> memcachedNodes="n1:centos-on-virtualbox-ip:11211"
> failoverNodes="n1"
> requestUriIgnorePattern=".*\.(png|gif|jpg|css|js|ico)$"
> sessionBackupAsync="false"
> sessionBackupTimeout="100"
>
> transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
>
> customConverter="de.javakaffee.web.msm.serializer.kryo.JodaDateTimeRegistration,de.javakaffee.web.msm.serializer.kryo.WicketSerializerFactory"
> />

When you want to use non-sticky sessions you have to set sticky="false"
- this is missing here.
Even for sticky mode failoverNodes="n1" with only a single memcachedNode
"n1" does not make sense. If you only have a single memcached than leave
failoverNodes empty. Of course for non-sticky sessions this should be
left empty anyways.


> Right now, I have the next tomcat 7 configuration on Centos:
>
> <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
> memcachedNodes="n1:centos-on-virtualbox-ip:11211"
> sticky="false"
> sessionBackupAsync="true"
> requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
>
> transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
> />
>
> In centos I have the next log output:
>
> de.javakaffee.web.msm.LockingStrategy pingSession
> WARNING: The session 64A4318C9F84A00539ADC6AFCE5B84A0-n1 should be
> touched in memcached, but it does not exist therein.
> Dec 17, 2013 3:22:25 PM
> de.javakaffee.web.msm.MemcachedSessionService loadFromMemcached
> WARNING: Could not load session with id
> 64A4318C9F84A00539ADC6AFCE5B84A0-n1 from memcached.
> java.lang.RuntimeException: The loaded object for sessionId
> 64A4318C9F84A00539ADC6AFCE5B84A0-n1 is not of required type byte[],
> but java.lang.Integer

You can try changing sessionBackupAsync to "false".


> In the app, I have the next maven dependencies:
>
> <dependency>
> <groupId>de.javakaffee.msm</groupId>
> <artifactId>msm-kryo-serializer</artifactId>
> <version>1.6.5</version>
> <scope>runtime</scope>
> </dependency>
> <dependency>
> <groupId>net.spy</groupId>
> <artifactId>spymemcached</artifactId>
> <version>2.10.3</version>
> </dependency>

You don't need the spymemcached dep here.


> In the $CATALINA_HOME/lib directory, I have the next related jars:
>
> asm-3.2, commons-codec-1.5,
> kryo-1.04, kryo-serializers-0.10, memcached-session-manager-1.6.5, memcached-session-manager-tc7-1.6.5, minlog-1.2, msm-kryo-serializer-1.6.5, netty-3.5.5.Final, reflectasm-1.01, spymemcached-2.10.3

msm-kryo-serializer, kryo and related jars should NOT go into
$CATALINA_HOME/lib! kryo is pulled into your webapp libs because it's a
transitive dep of msm-kryo-serializer.
If you follow the SetupAndConfiguration guide it should be fairly clear
which libs have to placed where.


> could you help me to fix this trouble?

Trying :-)

> do you know how I can to deal with this kind of trouble?

You should simplify as much as you can. Simplify your setup and simplify
your app! Start with the most simple setup and e.g. some jsp example
just to see that the setup is working, then continue with the simplest
possible ZK app. Take step by step and see when it's starting to break.

Cheers,
Martin

signature.asc

Sergio

unread,
Dec 26, 2013, 10:18:15 AM12/26/13
to memcached-se...@googlegroups.com, martin....@googlemail.com
Hi Martin

Thanks for your answers. According with your response:

msm-kryo-serializer, kryo and related jars should NOT go into 
$CATALINA_HOME/lib! kryo is pulled into your webapp libs because it's a 
transitive dep of msm-kryo-serializer.


I have the kryo libraries in $CATALINA_HOME/lib because when it doesn't have those libraries, the app throws the next exception:

Caused by: java.lang.ClassNotFoundException: de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at de.javakaffee.web.msm.MemcachedSessionService.loadTranscoderFactoryClass(MemcachedSessionService.java:553)
at de.javakaffee.web.msm.MemcachedSessionService.createTranscoderFactory(MemcachedSessionService.java:535)
at de.javakaffee.web.msm.MemcachedSessionService.getTranscoderFactory(MemcachedSessionService.java:480)
... 17 more

The unique way in that I can make to work it is putting in $CATALINA_HOME/lib the related libraries to Kryo. The last is according with the next response that I found here, in: https://groups.google.com/forum/#!msg/memcached-session-manager/npjqCiNkezk/hf08fdHllEcJ

When I check the maven dependencies I can't to find any jar with the class mentioned in the exception.

What does "SO" mean? What is the relationship of the windows and linux 
hosts, what are their roles?

I have Windows like host SO, and I have installed Centos in Virtualbox. Now in Centos, I have installed memcached service and two Tomcat instances. You know I'm doing a lot of tests.

You don't need the spymemcached dep here
I've eliminated the spymemcached dependency from the pom.xml file in the app.

When you want to use non-sticky sessions you have to set sticky="false" 
- this is missing here

I have the next configuration in both tomcat's context.xml file:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
   memcachedNodes="n1:localhost:11211 n2:localhost:11212"
   sticky="false"
   sessionBackupAsync="false"
   requestUriIgnorePattern=".*\.(png|gif|jpg|jpeg|bmp|ico|css|js|xml|html|htm)$"
   transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" />


I'm also using httpd like load balancer with the next configuration in httpd.conf file: 

<Proxy balancer://cluster>
    BalancerMember ajp://localhost:8009 route=node1
    BalancerMember ajp://localhost:9009 route=node2
</Proxy>
ProxyPass / balancer://cluster/

I've used the above configuration with the option "stickysession=JSESSIONID|jsessionid" too.

When I shutdown any tomcat instance trying to simulate a failover, I get the next behavior:

The browser ask me for a resend for information a couple of times, then, after a two or three clicks in those windows, the app can to continue with the normal events and request flows. But the app is involved with issues about money transactions, and you know, no one will be disposed to make many clicks with popups in middle saying: "I have to resend information" when your credit card information it's involved. If this last trouble goes, it'll be great!!!! because the task will be over.

could you help me to know how to solve this issue?

Martin Grotzke

unread,
Dec 27, 2013, 4:11:13 AM12/27/13
to memcached-se...@googlegroups.com
On 12/26/2013 04:18 PM, Sergio wrote:
> Hi Martin
>
> Thanks for your answers. According with your response:
>
> /msm-kryo-serializer, kryo and related jars should NOT go into
> $CATALINA_HOME/lib! kryo is pulled into your webapp libs because it's a
> transitive dep of msm-kryo-serializer./
>
> I have the kryo libraries in $CATALINA_HOME/lib because when it doesn't
> have those libraries, the app throws the next exception:
>
> Caused by: java.lang.ClassNotFoundException:
> de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
> at
> de.javakaffee.web.msm.MemcachedSessionService.loadTranscoderFactoryClass(MemcachedSessionService.java:553)
> at
> de.javakaffee.web.msm.MemcachedSessionService.createTranscoderFactory(MemcachedSessionService.java:535)
> at
> de.javakaffee.web.msm.MemcachedSessionService.getTranscoderFactory(MemcachedSessionService.java:480)
> ... 17 more

Can you submit an issue with enough information that allows to reproduce
this issue?


> The unique way in that I can make to work it is putting in
> $CATALINA_HOME/lib the related libraries to Kryo. The last is according
> with the next response that I found here,
> in: https://groups.google.com/forum/#!msg/memcached-session-manager/npjqCiNkezk/hf08fdHllEcJ
>
> When I check the maven dependencies I can't to find any jar with the
> class mentioned in the exception.

The KryoTranscoderFactory is provided by msm-kryo-serializer.


> /What does "SO" mean? What is the relationship of the windows and linux
> hosts, what are their roles?/
> I have Windows like host SO, and I have installed Centos in Virtualbox.
> Now in Centos, I have installed memcached service and two Tomcat
> instances. You know I'm doing a lot of tests.

I've still no clue what "SO" stands for. Perhaps it just doesn't matter,
I'll read it as "thing" for now ;-) Also the relationship/roles of
windows / linux is not clear to me. Probably this is also not relevant.



> I've used the above configuration with the option
> "stickysession=JSESSIONID|jsessionid" too.

With this config you obviously want to get sticky sessions, so you
should configure msm accordingly.


> When I shutdown any tomcat instance trying to simulate a failover, I get
> the next behavior:
>
> The browser ask me for a resend for information a couple of times, then,
> after a two or three clicks in those windows, the app can to continue
> with the normal events and request flows. But the app is involved with
> issues about money transactions, and you know, no one will be disposed
> to make many clicks with popups in middle saying: "I have to resend
> information" when your credit card information it's involved. If this
> last trouble goes, it'll be great!!!! because the task will be over.
>
> could you help me to know how to solve this issue?

As I already said (just pasting it here): You should simplify as much as
signature.asc

Sergio

unread,
Dec 27, 2013, 8:54:05 AM12/27/13
to memcached-se...@googlegroups.com, martin....@googlemail.com
Hi Martin

You're right, the information about the relationship between Windows and Linux isn't relevant, it was only for context.

About the why I put the kryo libs in the tomcat is because if I didn't do, then I get a exception. 

The configuration on apache with the sticky session option present in httpd.conf file, it's because I already proved without it ... I mean I've been prove with any possible combination, actually I need this working soon.

However, In some moment I though that the problem was apache with some kind of tricky configuration hiden into ther files, so I move on  to prove with nginx and I got the same results.

Right now I have the next:


SEVERE: Unable to serialize entry: responseWindow$ResponseController=com.controllers.ResponseController@29fdf006
Dec 26, 2013 6:35:30 PM de.javakaffee.web.msm.JavaSerializationTranscoder writeAttributes
WARNING: Cannot serialize session attribute javax.zkoss.zk.ui.Session for session E1404779ED38C46D11ABD874D8167F7F-n1
java.io.NotSerializableException: com.pagosonline.ppp4.core.common.util.EntityValidator
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.io.Serializables.smartWrite(Serializables.java:62)
at org.zkoss.zk.ui.AbstractComponent.writeObject(AbstractComponent.java:2866)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.zk.ui.AbstractComponent.writeObject(AbstractComponent.java:2852)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.zk.ui.AbstractComponent.writeObject(AbstractComponent.java:2852)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.zk.ui.AbstractComponent.writeObject(AbstractComponent.java:2852)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.zk.ui.AbstractComponent.writeObject(AbstractComponent.java:2852)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.zk.ui.AbstractComponent.writeObject(AbstractComponent.java:2852)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.zk.ui.AbstractPage.writeObject(AbstractPage.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at java.util.LinkedList.writeObject(LinkedList.java:943)
at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422)
at org.zkoss.zk.ui.impl.DesktopImpl.writeObject(DesktopImpl.java:999)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at java.util.HashMap.writeObject(HashMap.java:1001)
at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:422)
at org.zkoss.util.CacheMap.writeObject(CacheMap.java:620)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.zkoss.zk.ui.http.SimpleSession.writeThis(SimpleSession.java:445)
at org.zkoss.zk.ui.http.SerializableSession.writeObject(SerializableSession.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at de.javakaffee.web.msm.JavaSerializationTranscoder.writeAttributes(JavaSerializationTranscoder.java:139)
at de.javakaffee.web.msm.JavaSerializationTranscoder.serializeAttributes(JavaSerializationTranscoder.java:100)
at de.javakaffee.web.msm.TranscoderService.serializeAttributes(TranscoderService.java:153)
at de.javakaffee.web.msm.BackupSessionService.updateExpiration(BackupSessionService.java:131)
at de.javakaffee.web.msm.MemcachedSessionService.updateExpirationInMemcached(MemcachedSessionService.java:1589)
at de.javakaffee.web.msm.MemcachedBackupSessionManager.backgroundProcess(MemcachedBackupSessionManager.java:547)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1352)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:662)
Dec 26, 2013 6:35:30 PM de.javakaffee.web.msm.JavaSerializationTranscoder writeAttributes
FINE:   storing attribute 'javax.zkoss.zk.ui.Session' with value NOT_SERIALIZED
Dec 26, 2013 6:35:30 PM de.javakaffee.web.msm.JavaSerializationTranscoder writeAttributes
FINE:   storing attribute 'org.zkoss.zk.pi' with value 'org.zkoss.zk.ui.sys.HtmlPageRenders$PI@43d0e87c'
Dec 26, 2013 6:35:30 PM de.javakaffee.web.msm.JavaSerializationTranscoder writeAttributes
FINE:   storing attribute 'org.zkoss.zk.gae.fix' with value '0'
Dec 26, 2013 6:35:30 PM de.javakaffee.web.msm.BackupSessionTask doBackupSession
FINE: Trying to store session in memcached: E1404779ED38C46D11ABD874D8167F7F-n1
Dec 26, 2013 6:35:40 PM de.javakaffee.web.msm.MemcachedSessionService updateExpirationInMemcached
FINE: Checking session E1404779ED38C46D11ABD874D8167F7F-n1: 
- isValid: true
- isExpiring: false
- isBackupRunning: false
- isExpirationUpdateRunning: false
- wasAccessedSinceLastBackup: false
- memcachedExpirationTime: -16


I though that Kryo could deal with any type of object for serialization process. That was the main reason that I choose Kryo over Java serialization native.

You could say to me, what do you need to make clearest this issue and in that way maybe you could help me?

Actually I will be thankful if you could help me soon. I really think that this it's a better alternative to use redis or the native tomcat clustering options.

I'll waiting for any answer.

Thanks in advance.

Martin Grotzke

unread,
Dec 27, 2013, 11:26:06 AM12/27/13
to memcached-se...@googlegroups.com
On 12/27/2013 02:54 PM, Sergio wrote:
>
> Right now I have the next:
>
>
> SEVERE: Unable to serialize entry:
> responseWindow$ResponseController=com.controllers.ResponseController@29fdf006
> Dec 26, 2013 6:35:30 PM
> de.javakaffee.web.msm.JavaSerializationTranscoder writeAttributes
> WARNING: Cannot serialize session attribute javax.zkoss.zk.ui.Session
> for session E1404779ED38C46D11ABD874D8167F7F-n1
> java.io.NotSerializableException:
> com.pagosonline.ppp4.core.common.util.EntityValidator

EntityValidator is not Serializable. Should EntityValidator be
serialized at all (does it keep any state?), or should it be a transient
field?


> Dec 26, 2013 6:35:30 PM
> de.javakaffee.web.msm.JavaSerializationTranscoder writeAttributes
> FINE: storing attribute 'javax.zkoss.zk.ui.Session' with value
> NOT_SERIALIZED
> Dec 26, 2013 6:35:30 PM
> de.javakaffee.web.msm.JavaSerializationTranscoder writeAttributes
> FINE: storing attribute 'org.zkoss.zk.pi' with value
> 'org.zkoss.zk.ui.sys.HtmlPageRenders$PI@43d0e87c'

Should HtmlPageRenders be serialized?

You should review your session and what's going to be serialized (in
other words: inspect the object graph starting from the session). I can
imagine that your object graph contains stuff that should not be serialized.


> I though that Kryo could deal with any type of object for serialization
> process. That was the main reason that I choose Kryo over Java
> serialization native.

The advantage of kryo is that you can write custom serializers for 3rd
party classes (our of your control).


> You could say to me, what do you need to make clearest this issue and in
> that way maybe you could help me?

The best would be if you could provide a sample webapp that allows me to
reproduce the issue.
If that's not possible, you should simplify your setup as much as
possible and provide a clear description of the issue you're experiencing.

Cheers,
Martin

signature.asc
Reply all
Reply to author
Forward
0 new messages