I have a OSGI (Equinox-based) platform running a bundle. This bundle connects to Hazelcast for retrieving some data with:
ClientConfig clientConfig = new XmlClientConfigBuilder(configIs).build();
clientConfig.setClassLoader(com.MyClass.class.getClassLoader());
HazelcastInstance instance = com.hazelcast.client.HazelcastClient.newHazelcastClient(clientConfig);
But at runtime (instance.getMap(map).values()), during the deserialization of com.MyClass, I got the followin exception:
com.hazelcast.nio.serialization.HazelcastSerializationException: java.lang.ClassNotFoundException: com.MyClass
I don't really understand why Hazelcast would not be able to find com.MyClass, especially with the way I am calling the setClassLoader() method. The com.MyClass btw implements Serializable interface.
I know integrating Hazelcast with OSGI seems to be a common difficulty but I've not been able to find a resolution so far..
Any help would be appreciated :)
Edit:
I solved my issue. If one day someone faces the very same one, please not that Predicate are managed on server side. It means you must import the bean class in the Hazelcast classpath.