-
Notifications
You must be signed in to change notification settings - Fork 37
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
Deserialization problem when doing aggregate on a map #33
Comments
One way of solving the problem would be to create the hazelcast instance in the webapp's
|
@bergander can you achieve what you described in your last comment by setting an instance name for your As a proper fix, we can start the Hazelcast instance later in the process as you suggested and change its classloader. I didn't look into this yet, it might not be possible. |
If I try that I get this log entry from Hazelcast: And the following exception, which seems to be a bug in Hazelcast?:
So I still have a classloader issue with that solution. I can only get around the problem by using If I initialize Hazelcast in my webapp and then patch
|
@bergander if you send a pull request for your patch, we can review and merge it if there's no problems with it. |
Pull request created: #37 |
Thanks for the PR @bergander, I will review it as soon as possible. |
fixed by #37 |
I've got a problem with deserialization when doing aggregate on a map in a P2P configuration.
map.aggregate(Supplier.fromPredicate(filter::test), Aggregations.count());
This will throw an
HazelcastSerializationException
caused by aClassNotFoundException
. The problem is similar to this issue: #13The hazelcast thread doing the aggregate has a context ClassLoader with only the tomcat libraries, but it needs to have the webapp context classloader to be able to deserialize objects from the webapp. So I'm guessing the classloader in the config needs to be set to the webapp context classloader before creating the hazelcast instance (and the hazelcast threads). But currently the instance is created in the P2PLifecycleListener where the webapp context is not available. Should the instance be created in the SessionManager instead, like with the server-client case?
Or is there some other way to set the classloader in the webapp after the hazelcast instance has been created? Executing
instance.getConfig().setClassLoader(...)
seems to have no effect.The text was updated successfully, but these errors were encountered: