Issue
Why does HttpServletRequest.getRemoteAddr()
return null
sometimes? For approximately 2 out of 10 identical requests is returns null
for no apparent reason.
Solution
Using Tomcat7. Apparently getRemoteAddr()
can return NULL
if the request has already been consumed, i.e. a response has been sent. It can even throw NPE sometimes. An error in my code in any case.
Answered By - milan
Answer Checked By - Mary Flores (JavaFixing Volunteer)