Initially reported in this thread:
The DSpace XMLUI seems to respond with a 500 response (rather than a proper 404) for invalid paths which begin with "/static".
There seems to be two forms of errors..
1) NullPointerException (with 500 response) is thrown for URLs of this format:
In other words, the XMLUI path must start with "/static/", and it must end with either ".js", ".css" or ".json". Here's some examples from the demo.dspace.org server:
http://demo.dspace.org/xmlui/static/not/a/valid/file.js (500 response)
http://demo.dspace.org/xmlui/static/notvalid.css (500 response)
2) FileNotFoundException is thrown (with an incorrect 500 response) for URLs that begin with "/static" and have a subpath. Again, some examples from demo.dspace.org:
http://demo.dspace.org/xmlui/static/not/a/valid/path/ (500 response)
http://demo.dspace.org/xmlui/static/blah/notvalid.html (500 response)
http://demo.dspace.org/xmlui/static/notvalid.html (correct 404 response with a "ResourceNotFound" error)
Currently, if someone attempts to reference a .js/.css/.json file which does NOT exist, DSpace code is unfortunately throwing a Java NullPointerException (as it's failing to check if the requested file actually exists). Here's the line where the NullPointerException is thrown: