-
Notifications
You must be signed in to change notification settings - Fork 1.1k
support for Hazelcast client-server topology user-code-deployment not working #1319
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
Comments
Thanks for the report @michaelhaessig. As noted in #1101, we've got an integration test for Hazelcast's client-server topology that uses code deployment feature and it works for us without such problems. Can you provide a minimal sample that could be used to reproduce this problem? |
yes i've seen this test. i will try to find time this week to build a sample project. |
Thanks for providing the sample @michaelhaessig, it's much appreciated! Unfortunately, it turns out that in client-server topology we still need 3rd party classes that we store in the session (such as Spring Security in your case) present on the server's classpath. Our tests in this scenario only tested the initial save of the sessions, where We'll need to further improve the support for client-server topology by implementing the changes proposed in #1131. With that, this becomes a duplicate of #1131 - please track that one and feel free to vote on it and add further related comments there. |
Duplicate of #1131 |
Thanks for the fast feedback. Thats exactly what my investigation brought up too, and with a custom UserDetails object it required even more dependencies to our codebase on the hazelcast server. I temporarily resolved the situation by using a custom HazelcastSessionRepository implementation which does not use any EntryProcessors by just using It would be nice if this could be configured via a flag. The current HazelcastSessionRepository is not flexible to extend. I currently coppied most of its code. |
@michaelhaessig - I am facing the same exceptions while porting my application from SpringBoot 1.4.5 to 2.1.x .. Can you please share the work around .. do I need to include additional libraries in the classpath on the Hazelcast server and the client app ( in this case its a zuul server with oauth2 ) |
@consult-kk - sorry for the delayed reply. as mentioned i did replace the full HazelcastSessionRepository to use the old logic from 1.0 with IMap#put instead of using EntryProcessors. This way no libraries are needed on the hazelcast server. If you need the full code let me know. |
Hi @michaelhaessig, I am still facing the same problem with a custom UserDetails object. Hazelcast seems to be unable to load (private) nested classes (specifically the AuthorityComparator inside the User class). This is making it impossible to add User Authentication with Spring Security to my application. |
Hi @flacris , it has been a while since i mangaed this code :) As mentioned i had to create a full copy of the HazelcastSessionRepository. i've attached the implementation here: hazelcast-session-repository.zip Basically what you can see is the property "useEntryProcessor" in "CustomHazelcastSessionRepository" is set to false to not use the hazelcast server side entry processors which avoid having to deploy the full classes to an external hazelcast cluster. The "CustomSessionUpdateEntryProcessor" is just required to make the implementation complete (but it's not used when useEntryProcessor=false) Keep in mind this code is using older versions of spring/hazelcast. |
@michaelhaessig Thanks a lot for the code! Unfortunately, in the newest version of spring-session-hazelcast the use of HazelcastIndexedSessionRepository is deeply rooted in the Hazelcast configuration classes. This makes replacing the SessionRepository more complicated than anticipated. I will keep trying to find a way and hope that Hazelcast resolve their issues with user code deployment and offer better support for the client-server topology! |
Hi everyone
im in the process of updating from spring session 1, we have been using the client-server setup for quite some time in production.
Now with the new EntryProcessor implementation of HazelcastSessionRepository i cannot get it to work with the code deployment sample described in the issue #1101 .
i've enabled code deployment both on the server and on the client via the following xml configurations.
Server:
Client:
I know this config is working because it triggers a new downstream Error when hazelcast is trying to send the SessionUpdateEntryProcessor class to the server.
The Hazelcast server throws the following error:
I've tried to add spring-security jars to the hazelcast server, this fixed this error but triggered more downstream dependency errors.
Does anyone know how to fix this error ?
I've looked at the issues #1312 #1131 maybe they can fix my issue and the need to upload code to the hazelcast server.
To fix my situation i had to completely replace the HazelcastSessionRepository with my own implementation that uses the old way of get/put on the Hazelcast IMap. This is working for now.
Im looking forward to any suggesstions.
The text was updated successfully, but these errors were encountered: