incubator-s4-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raghavendar TS <raghav280...@gmail.com>
Subject Re: Serializing object of Instance.class in S4 0.3.0
Date Tue, 04 Sep 2012 07:47:58 GMT
Hi
By the way why is that object of Instance class is not getting dispatched
in S4 0.3.0?

Thankyou

On Tue, Sep 4, 2012 at 1:13 PM, Matthieu Morel <mmorel@apache.org> wrote:

> 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.**JsonObjectDeserializationVisit**or.constructTarget(**
>> JsonObjectDeserializationVisit**or.java:41)
>>      at
>> com.google.gson.**JsonDeserializationVisitor.**getTarget(**
>> JsonDeserializationVisitor.**java:56)
>>      at com.google.gson.**ObjectNavigator.accept(**
>> ObjectNavigator.java:101)
>>      at
>> com.google.gson.**JsonDeserializationContextDefa**ult.fromJsonObject(**
>> JsonDeserializationContextDefa**ult.java:73)
>>      at
>> com.google.gson.**JsonDeserializationContextDefa**ult.deserialize(**
>> JsonDeserializationContextDefa**ult.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