apache / shiro

Apache Shiro
https://shiro.apache.org/
Apache License 2.0
4.33k stars 2.31k forks source link

[Question]HttpSession constructor argument cannot be an instance of ShiroHttpSession. This is enforced to prevent circular dependencies and infinite loops. #1893

Closed iarora-rcc closed 18 hours ago

iarora-rcc commented 2 days ago

Search before asking

Question

I am getting this issue in my spring boot app, which uses Shiro for session management. Earlier it was a EKS based app directly talking with the Load balancer. Now we are planning to add a API Gateway krakend API gateway to monitor API calls reaching my backend server. The app was working fine , however, now it is giving us above mentioned issue. I am getting this issue while calling the below line: Session userSession = new HttpServletSession(request.getSession(), ipAddress);

lprimak commented 2 days ago

Hi,

There is not nearly enough information here to even begin to answer your question. A reproducer, or at least a full stack trace would be necessary. I can only guess that you should probably use request.getSession() directly and not instantiate HttpServletSession

iarora-rcc commented 18 hours ago

Hi @lprimak thanks for a prompt reply. I actually ran the API Gateway in local and things were working fine in terms of routing. Let me see , how can I solve it.