getRemoteUser returns the user ID that the user logged in under. BUT only if that user was authenticated using the
J2EE standard container security system.
If the webapp was not deployed in a J2EE security Realm, or if the webapp is using a non-standard security system, the webapp server will not process logins and will not capture and forward the user ID as part of the HttpServletRequest. In which case both getRemoteUser and getUserPrincipal will return null.
Most likely, if the other apps are working, there's an issue with this webapp's deployment context and specifically with its security realm configuration.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.