While the solutions proposed are trivial to implement, I have to agree with Valentin.
Pires On Mon, Dec 7, 2015 at 7:12 PM, Valentin Kulichenko < [email protected]> wrote: > Alex, > > I don't like this. I think both marshallers should behave in the same way > and this behavior should be consistent with Java serialization spec. I > hardly believe that classes like in Paulo's example will be used for > communication with .NET/C++. And I would prefer to have such restrictions > for interop, rather than for Java-only scenario. > > -Val > > On Mon, Dec 7, 2015 at 9:51 AM, Alexey Goncharuk < > [email protected]> wrote: > >> Paulo, >> >> After a closer look I see that BinaryMarshaller works the way it was >> designed to work. The issue is that your class implements Map and >> Serializable, but does not define writeObject(), that's why Ignite >> serializes it in the portable format discarding information about the >> custom user type (this way it can be read in other platforms - .NET and C++) >> >> There are two ways to solve this. First is to set OptimizedMarshaller in >> configuration (this marshaller was the default marshaller in ignite-1.4). >> The second one would be to define writeObject() method in your class which >> will call defaultWriteObject, like this: >> >> private void writeObject(ObjectOutputStream s) >> throws IOException { >> s.defaultWriteObject(); >> } >> >> I am also curious what other community members think about current >> behavior. >> >> 2015-12-07 20:38 GMT+03:00 Paulo Pires <[email protected]>: >> >>> With 3fbf3e9 the issue is still there. >>> >>> On Mon, Dec 7, 2015 at 11:28 AM, Andrey Gura <[email protected]> wrote: >>> >>>> Paulo, >>>> >>>> I see commit with fix in master branch. >>>> >>>> commit 2564a556e353269d4adc58160512ed9d0a5979b4 >>>> Author: Alexey Goncharuk <[email protected]> >>>> Date: Tue Dec 1 17:37:41 2015 +0300 >>>> >>>> IGNITE-1695 - Fixed writing polymorphic types. >>>> >>>> >>>> Could you please make sure that you have codebase with this commit and >>>> repeat your test? >>>> >>>> >>>> On Mon, Dec 7, 2015 at 1:37 PM, Paulo Pires <[email protected]> >>>> wrote: >>>> >>>>> Hi Andrey, >>>>> >>>>> This is great news! While marked as fixed, it doesn't seem to have hit >>>>> the Github clone repo. Am I missing something? Would like to keep on >>>>> testing 1.5 before it gets released. >>>>> >>>>> Pires >>>>> >>>>> On Mon, Dec 7, 2015 at 10:22 AM, Andrey Gura <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi Paulo, >>>>>> >>>>>> it is know issue (see JIRA ticket >>>>>> https://issues.apache.org/jira/browse/IGNITE-1695) >>>>>> >>>>>> The problem is fixed and fix will be included into nearest ignite-1.5 >>>>>> release. >>>>>> >>>>>> On Mon, Dec 7, 2015 at 2:32 AM, Paulo Pires <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I have the following class http://pastebin.com/QD4tmH29 and while >>>>>>> it works fine with 1.4.0 it is not working with 1.5 built from source. >>>>>>> The >>>>>>> error is: >>>>>>> >>>>>>> java.lang.ClassCastException: java.util.HashMap cannot be cast to >>>>>>> xxx.DeviceSubscriptionFilterMap >>>>>>> >>>>>>> Ideas? >>>>>>> -- >>>>>>> Cheers, >>>>>>> Pires >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Andrey Gura >>>>>> GridGain Systems, Inc. >>>>>> www.gridgain.com >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Cheers, >>>>> Pires >>>>> >>>> >>>> >>>> >>>> -- >>>> Andrey Gura >>>> GridGain Systems, Inc. >>>> www.gridgain.com >>>> >>> >>> >>> >>> -- >>> Cheers, >>> Pires >>> >> >> > -- Cheers, Pires
