XML Parsing Error: no element found Location: http://localhost:8081/web-app/pages/login.xhtml Line Number 1, Column 1: ^

前端 未结 2 2238
野的像风
野的像风 2021-01-19 14:54

My login.xhtml starts with:




        
2条回答
  •  梦谈多话
    2021-01-19 15:33

    XML Parsing Error: no element found Location: [...] Line Number 1, Column 1

    To the point, this exact error means that the webbrowser retrieved an entirely empty response while it is being instructed to interpret the response as XML, usually via the Content-Type header such as application/xhtml+xml or application/xml, or if absent, via the file extension in URL such as .xhtml or .xml.

    Given that this happens while requesting a JSF login page, this strongly suggests that it contained a syntax/runtime error and that the webapp doesn't have error handling correctly configured. Apparently error pages themselves are also blocked behind a login/security constraint, causing the server being unable to present a "normal" error page with all exception detail and therefore return a completely empty response.

    Your best bet is reading the server logs for the actual exception and/or running a debugger and/or creating a JSF exception handler which explicitly logs exceptions to server log (just in case you couldn't find exceptions and thus they appear to be swallowed). Once having the actual exception at hands, it's usually a matter of using the exception type + message + 1st line as keywords to find clues on the Internet.

提交回复
热议问题