简体   繁体   中英

Session Replication and clustering using Spring Session and HazelCast IMDG on WildFly 18

As per the requirement, I have to make the WebApp sessions to be clustred on WildFly 18.

I'm using Spring session to manage the clustering and filtering along with Spring Security. The WebApp is using JSF 2.3 as fronted, and I'm using HazelCast to replicate and store the session.

The problem is, when I try to run my application on WildFly, once logged in, if I try to refresh the page or navigate to other page I'm getting logged out instantly. The same app is working fine on Tomcat, hence there must be something going on with WildFly configuration.

What I have done till now is:

  • I'm using standalone.xml (with default configuration) instead of full or full-ha.
  • I have removed <distributable/> from web.xml (although the result is same either I add it or not to web.xml).
  • I'm Using hazelcast-all.jar in my project.

So, should I have to do anything in WildFly to stop using its inbuilt infispan clustering?

I've searched over and found this: https://developer.jboss.org/thread/266186?_sscc=t

I'm sure I'm missing something while configuring the app with wildfly.

Any help would be appreciated.

Removing from web.xml will cause WildFly to use a ConcurrentHashMap-based session manager (ie no more Infinispan). Spring Session is supposed to hijack the request such that no HttpSessions are ever created (in WF's session manager). This means you can't use WildFly to manage security (ie standard JEE authentication/authorization), as everything will need to be managed by Spring.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM