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

Getting HazelcastSerializationException from .Net Client when retrieving data from Java Hazelcast intance #8985

Closed
manikandan22k opened this issue Sep 26, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@manikandan22k
Copy link

commented Sep 26, 2016

I'm loading database data into IMap<string, MemberDetails>in my Java project. Here the MemberDetails contains List of MemberDetail. Where MemberDetail contains 3 column's setter/getter. Both MemberDetails & MemberDetail are POJO classes and implements Serializable interface in Java. I'm trying to get theIMap<string, MemberDetails>` from .Net webservice using HazelCast .Net client dll. I'm able to contact Hazelcast member which is running Java Environment and get the IMap object from .Net. But when i try to retrieve data from the IMap (which i got from .net client) it throws HazelcastSerializationException saying that "There is no suitable deserialization method found for this type -100" from .Net client.
Please help me on this issue to resolve. Do i need to use any Serializable interface from Hazelcast? Or is there any Deserialization method to be implemented in .Net Client? Thanks in advance.

@jerrinot jerrinot added this to the 3.8 milestone Oct 19, 2016

@sancar

This comment has been minimized.

Copy link
Member

commented Jan 9, 2017

You need to make your MemberDetails class implement either IdentifiedDataSerializable or Portable.
Both on server and client. For server side see doc here.
http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#serialization

For client side portable class see:
https://github.com/hazelcast/hazelcast-csharp-client/blob/master/Hazelcast.Examples/Models/Customer.cs
Corresponding factory class should look like this
https://github.com/hazelcast/hazelcast-csharp-client/blob/master/Hazelcast.Examples/Models/ExamplePortableFactory.cs

Similarly you can use identifiedDataSerilizable an example class
https://github.com/hazelcast/hazelcast-csharp-client/blob/master/Hazelcast.Examples/Models/Employee.cs
For this one you need to implement a class extending this interface
https://github.com/hazelcast/hazelcast-csharp-client/blob/master/Hazelcast.Net/Hazelcast.IO.Serialization/IDataSerializableFactory.cs

This how you use in an application. Note that you need to register factory classes to client configuration.

https://github.com/hazelcast/hazelcast-csharp-client/blob/master/Hazelcast.Examples/Map/MapPortableExample.cs

@sancar sancar closed this Jan 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.