Friday, January 28, 2011

Parameter WARNING from Tomcat catalina.out

More often than not, we see tomcat server log prints many warnings, and 2 are very common. After some tests and google, these are warning and will not impact tomcat a lot.

Jan 28, 2011 6:22:53 PM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Invalid chunk ignored.
Jan 28, 2011 6:23:11 PM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Character decoding failed. Parameter skipped.
java.io.CharConversionException: isHexDigit
Jan 28, 2011 6:42:54 PM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Character decoding failed. Parameter skipped.
java.io.CharConversionException: EOF

action.do?cmd=yourcmd&username=yourname&&password=yourpass (Invalid chunk ignored.)
action.do?cmd=yourcmd&username=yourname&%password=yourpass (Character decoding failed...isHexDigit)
action.do?cmd=yourcmd&username=yourname%&password=yourpass (Character decoding failed...EOF)

These characters are used to URL specific function like “&” id used to differentiate various URL parameters. This generates a “null” value for the parameter you will try to retrieve in Servlet. % is URL reserved character for urlencode.

Solution:
The simple way to get over this problem is to massage your Special Character String with “escape()” funtion in javascript, so & will get encoded to %26, % will get encoded to %25. In Java, URLEncode can also do the same protection.

No comments:

Post a Comment