You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2018/04/05 16:03:35 UTC

[Bug 62263] New: java.lang.NullPointerException when using RemoteIpValve

https://bz.apache.org/bugzilla/show_bug.cgi?id=62263

            Bug ID: 62263
           Summary: java.lang.NullPointerException when using
                    RemoteIpValve
           Product: Tomcat 9
           Version: 9.0.6
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: pschmidt@metzler.com
  Target Milestone: -----

Created attachment 35844
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35844&action=edit
server.xml with added RemoteIpValve

Steps to reproduce for a newly downloaded instance of Tomcat 9.0.6:

1. Add RemoteIpValve in server.xml

<Valve className="org.apache.catalina.valves.RemoteIpValve"
     protocolHeader="x-forwarded-proto" />

See also attachment.

2. Delete webapps\ROOT

3. Startup

Request for Root-URL 

http://localhost:8080

or any other not present context

http://localhost:8080/foo

leads to

05-Apr-2018 17:52:05.780 SCHWERWIEGEND [http-nio-8080-exec-2]
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:407)
        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:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

Reproducable for Windows 7 and CentOS 6.9.

In our production environment we also get this exception, although there is a
ROOT-Context (alas a custom one) deployed. I will do some furher investigations
tomorrow.

Thanks a lot in advance.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62263] java.lang.NullPointerException when using RemoteIpValve

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62263

--- Comment #2 from pschmidt@metzler.com ---
Thank you for fixing :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 62263] java.lang.NullPointerException when using RemoteIpValve

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62263

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 OS|                            |All

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report.

Fixed in:
- trunk for 9.0.8 onwards
- 8.5.x for 8.5.31 onwards
- 8.0.x for 8.0.51 onwards
- 7.0.x for 7.0.86 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org