incubator-s4-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Morel <mmo...@apache.org>
Subject Re: Serializing object of Instance.class in S4 0.3.0
Date Tue, 04 Sep 2012 07:43:32 GMT
Hi, the detailed stack trace states that you cannot serialize your 
Instance class due to a missing no-args constructor. I would recomend to 
follow the provided suggestion for GSON, which is : "Register an 
InstanceCreator with Gson for this type to fix this problem".

Note that the missing no-arg constructor is also an issue when you 
serialize with kryo 1, so you'd have to modify the provided serializer 
to include custom serialization for the instance class. Please refer to 
the kryo documentation for this.

Regards,

Matthieu.

On 9/4/12 9:19 AM, Raghavendar TS wrote:
> Hi
> In S4 0.3.0 I am trying to dispatch object of Instance.class from one PE
> to another.But it is not working.ie <http://working.ie> PE2 is not
> receiving events from PE1 if the event consist of object of
> Instance.class.What may be the problem?
>
> Also I tried using GSON to serialize objects of Instance.class to string
> and vice versa.It is throwing the exception during deserialization
>
> Exception in thread "main" java.lang.RuntimeException: No-args
> constructor for interface weka.core.Instance does not exist. Register an
> InstanceCreator with Gson for this type to fix this problem.
>      at
> com.google.gson.MappedObjectConstructor.constructWithNoArgConstructor(MappedObjectConstructor.java:64)
>      at
> com.google.gson.MappedObjectConstructor.construct(MappedObjectConstructor.java:53)
>      at
> com.google.gson.JsonObjectDeserializationVisitor.constructTarget(JsonObjectDeserializationVisitor.java:41)
>      at
> com.google.gson.JsonDeserializationVisitor.getTarget(JsonDeserializationVisitor.java:56)
>      at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:101)
>      at
> com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:73)
>      at
> com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:51)
>      at com.google.gson.Gson.fromJson(Gson.java:495)
>      at com.google.gson.Gson.fromJson(Gson.java:444)
>      at com.google.gson.Gson.fromJson(Gson.java:396)
>      at com.google.gson.Gson.fromJson(Gson.java:372)
>      at gson.main(gson.java:62)
>
> What is the problem.
>
> How can I dispatch such objects in S4 0.3.0.


Mime
View raw message