Kryo 3.0.1 - still get NullPointerException when try to deserialize ArrayList !

928 views
Skip to first unread message

Eylon Segal

unread,
Jun 30, 2015, 3:12:37 PM6/30/15
to kryo-...@googlegroups.com
I can't get over this - whatever I do ... !
 
either if I uses DefaultInstantiatorStrategy or StdInstantiatorStrategy for the ArrayList.class I get the Exception...
 
I don't know what else I can do - need help please !
------------------------------------------------------------------------------------------------------
 

((Kryo.DefaultInstantiatorStrategy) kryo.getInstantiatorStrategy()).setFallbackInstantiatorStrategy(

new StdInstantiatorStrategy());

//InstantiatorStrategy defaultInstantiatorStrategy = new DefaultInstantiatorStrategy();

InstantiatorStrategy stdInstantiatorStrategy =

new StdInstantiatorStrategy();

kryo.getRegistration(ArrayList.

class).setInstantiator(stdInstantiatorStrategy.newInstantiatorOf(ArrayList.class));

Nate

unread,
Jun 30, 2015, 3:21:32 PM6/30/15
to kryo-users
I don't see an exception in your post.

--
You received this message because you are subscribed to the "kryo-users" group.
http://groups.google.com/group/kryo-users
---
You received this message because you are subscribed to the Google Groups "kryo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kryo-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eylon Segal

unread,
Jul 1, 2015, 4:46:39 AM7/1/15
to kryo-...@googlegroups.com
2015-06-30 21:36:27,351 ERROR [UIRKryoEncoderDecoderImpl-serializeFromBytes]Exception in serializeFromBytes : java.lang.NullPointerException
Serialization trace:
subscriberProfile (com.starhome.services.promotion.sparx.datatypes.SparxSFIDataMsg)
msg (com.starhome.services.promotion.datatypes.PromotionSFIData)
com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
Serialization trace:
subscriberProfile (com.starhome.services.promotion.sparx.datatypes.SparxSFIDataMsg)
msg (com.starhome.services.promotion.datatypes.PromotionSFIData)
 at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:150)
 at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:557)
 at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:705)
 at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:131)
 at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:557)
 at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:787)
 at com.starhome.resources.uir.uircache.redis.kryo.UIRKryoEncoderDecoderImpl.serializeFromBytes(UIRKryoEncoderDecoderImpl.java:179)
 at com.starhome.resources.uir.uircache.redis.kryo.UIRKryoEncoderDecoderImpl.decodeUIRObjectFromProtocolBufferMap(UIRKryoEncoderDecoderImpl.java:98)
 at com.starhome.resources.uir.uircache.UirCache.fetchFromRedisCache(UirCache.java:1556)
 at com.starhome.resources.uir.uircache.UirCache.findDataInCache(UirCache.java:846)
 at com.starhome.resources.uir.uircache.UirCache.searchByImsi(UirCache.java:719)
 at com.starhome.resources.uir.uircache.UirCache.findDataInCache(UirCache.java:575)
 at com.starhome.resources.uir.SyncUirImpl.request(SyncUirImpl.java:76)
 at com.starhome.resources.uir.UIRConnector.syncRequest(UIRConnector.java:306)
 at com.starhome.services.utils.oneFetchOneSet.OneFetch.fetchData(OneFetch.java:506)
 at com.starhome.services.utils.oneFetchOneSet.OneFetch.oneFetch(OneFetch.java:281)
 at com.starhome.services.utils.oneFetchOneSet.OneFetch.oneFetch(OneFetch.java:138)
 at com.starhome.services.promotion.stateHandlers.InitHandler.handleLoadGenericSubscriber(InitHandler.java:397)
 at com.starhome.services.promotion.stateHandlers.InitHandler.initSessionOnVirtualEvent(InitHandler.java:333)
 at com.starhome.services.promotion.stateHandlers.InitHandler.initSession(InitHandler.java:261)
 at com.starhome.services.promotion.stateHandlers.InitHandler.handleInit(InitHandler.java:190)
 at com.starhome.services.promotion.stateHandlers.InitHandler.handleEvent(InitHandler.java:117)
 at com.starhome.services.promotion.ServiceManagerPromotion.handleEvent(ServiceManagerPromotion.java:1813)
 at com.starhome.services.promotion.ServiceManagerPromotion.onEvent(ServiceManagerPromotion.java:805)
 at com.starhome.ise.itcm.ContextProcessor.handleEvent(ContextProcessor.java:513)
 at com.starhome.ise.itcm.ContextProcessor.processContext(ContextProcessor.java:309)
 at com.starhome.ise.itcm.ContextProcessor.run(ContextProcessor.java:764)
 at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
 at java.util.Arrays$ArrayList.size(Arrays.java:2847)
 at java.util.AbstractList.add(AbstractList.java:108)
 at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134)
 at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40)
 at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:705)
 at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:131)
 ... 27 more

Nate

unread,
Jul 1, 2015, 6:49:44 AM7/1/15
to kryo-users
I can only guess without an SSCE, but probably ArrayList gets created without its constructor being called (that is what StdInstantiatorStrategy does), so it's internal state is inconsistent (meaning FUBAR).

Scott D.

unread,
Jul 2, 2015, 11:38:57 AM7/2/15
to kryo-...@googlegroups.com
See: https://github.com/EsotericSoftware/kryo/issues/314

If that is the issue you are trying to work around, this is fixed in 3.0.2.
Reply all
Reply to author
Forward
0 new messages