tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53411] NullPointerException in org.apache.tomcat.util.buf.CharChunk
Date Wed, 13 Jun 2012 20:49:32 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53411

--- Comment #4 from Konstantin Kolinko <knst.kolinko@gmail.com> ---
Just for reference, confirming what Mark already wrote,
in tc7.0.x/tags/TOMCAT_7_0_27

CharChunk.java line 355
[[[
354     public void append(String s) throws IOException {
355     append(s, 0, s.length());
356     }
]]]

So "s" is null.

Mapper.java line 667
[[[
666     if (host.isNull()) {
667     host.getCharChunk().append(defaultHostName);
668     }
]]]

So "defaultHostName" is null.

The "if(host.isNull())" branch is executed when it is an HTTP/1.0 request that
does not have a "Host" header. Such requests are rare nowadays.


(In reply to comment #2)
> <Engine name="Catalina" defaultHost="localhost">

There must exist <Host name="localhost" > for that. If it does not, the
defaultHost value will be ignored.

MapperListener.java
[[[
        if(found) {
            mapper.setDefaultHostName(defaultHost);
        } else {
            log.warn(sm.getString("mapperListener.unknownDefaultHost",
                    defaultHost, connector));
        }
]]]

-- 
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


Mime
View raw message