NullPointerException in Request.notifyAttributeAssigned with RemoteIpValve on Tomcat 9

Solution Unverified - Updated -

Issue

  • We see the following error for some requests when using the RemoteIpValve on Tomcat 9:
SEVERE [http-nio-20000-exec-10] org.apache.coyote.http11.Http11Processor.service Error processing request
 java.lang.NullPointerException
        at org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1525)
        at org.apache.catalina.connector.Request.setAttribute(Request.java:1511)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:665)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:414)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

Environment

  • JBoss Enterprise Web Server (JWS) 5.0.x
    • Tomcat 9.0.7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In