Summary: | NullPointer for every request | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Erik Pragt <epragt> |
Component: | Unknown | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 5.5.4 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Erik Pragt
2004-12-15 00:06:16 UTC
Do you see this in conf/catalina.properties: tomcat.util.buf.StringCache.byte.enabled=true ? So you can easily work around the problem. I don't understand what causes the bug. Can you submit a better test case (similar code runs fine for me) ? It's really odd that you're getting an exception there, because it can only happen if the String value is null, and this should be filtered out before going into the StringCache because it's obviously useless. I could make the code a little bit more defensive, but this should not be needed. (In reply to comment #2) > I don't understand what causes the bug. Can you submit a better test case > (similar code runs fine for me) ? You could also get it from an unsupported encoding in toStringInternal. (In reply to comment #1) > Do you see this in conf/catalina.properties: > tomcat.util.buf.StringCache.byte.enabled=true ? > So you can easily work around the problem. Done, which works, but causes other problems like getting 'white pages' on some GET requests. I found out how the problem arrised. When looking in server.xml, was a connector entry: <Connector URIEncoding="null" enableLookups="true" port="9000" redirectPort="-1" backlog="10" disableUploadTimeout="false"> </Connector> As you can see, the URIUncoding is null. I don't know what it means excactly, but I didn't put it there. I used the admin tool to add the connector. I'd like to try to reproduce the problem, but my Admin tool doesn't work anymore. I cannot collapse items (I don't know if I should file this as another bug report, but I cannot say more than: my menuitems don't collapse anymore after adding a new service...) After removing the URIencoding, everything is working fine again, even after re-enabling the StringCache. (In reply to comment #2) > I don't understand what causes the bug. Can you submit a better test case > (similar code runs fine for me) ? > > It's really odd that you're getting an exception there, because it can only > happen if the String value is null, and this should be filtered out before going > into the StringCache because it's obviously useless. I could make the code a > little bit more defensive, but this should not be needed. ps, please leave the code unchanged. I like the webserver to not when something is not right, instead of eg. continue-ing the webserver and maybe causing some servere errors elsewhere, while not knowing what caused the problem. (In reply to comment #5) > ps, please leave the code unchanged. I like the webserver to not when something > is not right, instead of eg. continue-ing the webserver and maybe causing some > servere errors elsewhere, while not knowing what caused the problem. > [type] I like the webserver to not when... = I like the webserver to 'crash' when... Then the cause of the problem is what Bill said: an invalid encoding is used for the String. I think I should be able to reproduce the issue now, and I'll try to see if I can improve the situation. The admin works again in 5.5.6, BTW. I don't know if it handles connectors correctly or not, as I didn't use it at all in the 5.5 branch. I tried the admin webapp, and while it's probably not perfect for connector handling, it didn't save bad information (such as URIEncoding="null"), and Tomcat operated fine after a restart. |