This problem is caused by the Http Content Negotiation logic and the values of http headers. If the user accesses the url, the browser is sending the http headers and values of the client information as follows
(This output is sample http headers)
accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
accept-language: en-us,en;q=0.5
accept-encoding: gzip,deflate
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive: 300
connection: keep-alive
Grails reads these http headers before executing the controller action, and DefaultAcceptHeaderParser program parses the http headers sent from the client. When the value of "accept" or "content type" http header is including the value "application/xhtml+xml" or "application/xml", Grails parses these http headers and tries to find the "q" parameter into the "accept" or "content-type" header.
While parsing the headers, the NullPointerException occurs because some client program doesn't have the "q" parameter value into the http header even though the accept header includes the value "application/xhtml+xml" or "application/xml".