4

I'm working on project which is recently upgraded to 3.7.1, after upgrade whenever I'm using more than 1 request ( in my case it's 3 requests ) at same time I'm getting this error.

IllegalStateException: UT000021: Session already invalidated"

the exception in log is this:

gateway-app_1        |         at  io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
gateway-app_1        |         at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
gateway-app_1        |         at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
gateway-app_1        |         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
gateway-app_1        |         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
gateway-app_1        |         at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)
gateway-app_1        |         at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)
gateway-app_1        |         at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)
gateway-app_1        |         at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
gateway-app_1        |         at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)
gateway-app_1        |         at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
gateway-app_1        |         at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:802)
gateway-app_1        |         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
gateway-app_1        |         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
gateway-app_1        |         at java.lang.Thread.run(Thread.java:745)
gateway-app_1        | Caused by: java.lang.IllegalStateException: UT000021: Session already invalidated
gateway-app_1        |         at io.undertow.server.session.InMemorySessionManager$SessionImpl.invalidate(InMemorySessionManager.java:521)
gateway-app_1        |         at io.undertow.server.session.InMemorySessionManager$SessionImpl.invalidate(InMemorySessionManager.java:507)
gateway-app_1        |         at io.undertow.servlet.spec.HttpSessionImpl.invalidate(HttpSessionImpl.java:198)
gateway-app_1        |         at com.hazelcast.web.WebFilter$RequestWrapper.readSessionFromLocal(WebFilter.java:507)
gateway-app_1        |         at com.hazelcast.web.WebFilter$RequestWrapper.getSession(WebFilter.java:471)
gateway-app_1        |         at com.hazelcast.web.WebFilter$RequestWrapper.getSession(WebFilter.java:410)
gateway-app_1        |         at org.springframework.web.servlet.support.SessionFlashMapManager.retrieveFlashMaps(SessionFlashMapManager.java:45)
gateway-app_1        |         at org.springframework.web.servlet.support.AbstractFlashMapManager.retrieveAndUpdate(AbstractFlashMapManager.java:93)
gateway-app_1        |         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:889)
gateway-app_1        |         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
gateway-app_1        |         ... 96 common frames omitted

Is there any solution?

UPDATE 01:

this is my gateway .yo-rc.json

{
  "generator-jhipster": {
    "jhipsterVersion": "3.7.1",
    "baseName": "gateway",
    "packageName": "com.my.package.gateway",
    "packageFolder": "com/my/package/gateway",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "no",
    "clusteredHttpSession": "hazelcast",
    "websocket": false,
    "databaseType": "mongodb",
    "devDatabaseType": "mongodb",
    "prodDatabaseType": "mongodb",
    "searchEngine": false,
    "buildTool": "gradle",
    "jwtSecretKey": "fdsfsdfsfsfs",
    "useSass": true,
    "applicationType": "gateway",
    "testFrameworks": [
      "gatling",
      "cucumber",
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en"
    ]
  }
}
navid_gh
  • 1,863
  • 3
  • 17
  • 30
  • Looks like you're using Hazelcast for session clustering, and you don't give any information on your security mechanism (I'm gessing session-based?) -> we can't help you if you don't give us your full configuration – Julien Dubois Sep 19 '16 at 10:06
  • I didn't touch anything from previous version.I just used the upgrade sub generator and fixed the conflicts. Please tell me what exactly you need and I will update my post @JulienDubois – navid_gh Sep 19 '16 at 10:39
  • @Julien-Dubois anything? – navid_gh Sep 20 '16 at 06:42
  • This is probably an issue with Undertow, it looks linked to https://github.com/jhipster/generator-jhipster/issues/4189 – Julien Dubois Sep 22 '16 at 15:47

0 Answers0