I am developing a Web/EE project, using GlassFish
4
as an Application Server.
I have a SessionScoped
ManagedBean
called UserStateBean
and a AdminDirNotAdminDeniedFilter
that acts as the 2nd filter of the filter chain, and checks if the logged in user per question is an admin.
The code of the Filter, in which I get access to the ManagedBean
is this:
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
HttpSession session = request.getSession(false);
UserStateBean userState = (UserStateBean) session.getAttribute("userStateBean");
And after that I am calling the isAdmin()
function on the userState
instance: if (!userState.isAdmin())
and that's where I am getting the NoSuchMethodError.
I have verified that the userState
instance is not null and that contains the correct username
and password
using the debugger.
This is an extract from the server.log
of GlassFish
.
And this is the UserStateBean.