Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultTreeMode Serialization Problem #438

Open
ymnrad opened this issue Nov 12, 2021 · 0 comments
Open

DefaultTreeMode Serialization Problem #438

ymnrad opened this issue Nov 12, 2021 · 0 comments

Comments

@ymnrad
Copy link

ymnrad commented Nov 12, 2021

I am trying to implement ViewList Facelet and I am using Primefaces v8.0 TreeNode.
The DefaultTreeNode should be serialized with Kryo and saved in Redis and De-Serializedwith Kryo. It seems Kryo couldnt serializethe DkBaum Object since it contains DefaultTreeNode. The thing I couldnt understand, is that the DefaultTreeMode is Serializable.

The Bib we use:

  1. Tomcat 7
  2. Kryo Serializer 0.45
  3. memcached session manager 2.3.2
  4. Redis
  5. Primefaces 8
    ...

Any help is appreciated. Thanks allot in advance.
...

Serialization trace:
children (org.primefaces.model.DefaultTreeNode)
rootTreeNode (*****.******.*****.BaumView)
instance (org.jboss.weld.contexts.SerializableContextualInstanceImpl)
        at de.javakaffee.web.msm.serializer.kryo.KryoTranscoder.deserializeAttributes(KryoTranscoder.java:217)
        at de.javakaffee.web.msm.TranscoderService.deserializeAttributes(TranscoderService.java:167)
        at de.javakaffee.web.msm.TranscoderService.deserialize(TranscoderService.java:124)
        at de.javakaffee.web.msm.MemcachedSessionService.loadFromMemcached(MemcachedSessionService.java:1155)
        at de.javakaffee.web.msm.MemcachedSessionService.findSession(MemcachedSessionService.java:605)
        at de.javakaffee.web.msm.MemcachedBackupSessionManager.findSession(MemcachedBackupSessionManager.java:218)
        at org.apache.catalina.ha.tcp.ReplicationValve.createPrimaryIndicator(ReplicationValve.java:615)
        at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:320)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
        at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:188)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2555)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2544)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
Serialization trace:
children (org.primefaces.model.DefaultTreeNode)
rootTreeNode (****.*****.*****BaumView)
instance (org.jboss.weld.contexts.SerializableContextualInstanceImpl)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:144)
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543)
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
        at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:161)
        at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:39)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:709)
        at de.javakaffee.web.msm.serializer.kryo.KryoTranscoder.deserializeAttributes(KryoTranscoder.java:215)
        ... 16 more
Caused by: java.lang.NullPointerException
        at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:240)
        at java.util.ArrayList.ensureCapacity(ArrayList.java:221)
        at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:114)
        at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40)
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
        ... 28 more````




```@Named("bview")
@SessionScoped
public class BaumView implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2912669851825948112L;

	private DefaultTreeNode rootTreeNode;

	private Map<String, Serializable> dkMapSlim;
	private DefaultTreeNode selectedNode;
	private Date datumErstelltAm;
	private Boolean zipped;
... ```




Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant