HttpServletRequest.isUserInRole() always returns false
I have problem with HttpServletRequest.isUserInRole() method on GlassFish v 3.1. It returns 'true' only once after deploying the application and then always returns 'false'. HttpServletRequest.getUserPrincipal() works fine.
I use LDAP realm with user groups defined. I have described roles in <security-role>, <security-constraint>/<auth-constraint>/<role-name> and <servlet>/<security-role-ref> elements in web.xml and also mapped them to user groups in <security-role-mapping> elements in sun-web.xml.