java.lang.IllegalArgumentException: null source

前端 未结 4 844
终归单人心
终归单人心 2020-12-06 02:34

We have an application which uses JSF2 and Spring. The application works fine when deployed. But this happens if I went through the following steps:

  1. Open the l
相关标签:
4条回答
  • 2020-12-06 02:46

    This looks like http://java.net/jira/browse/JAVASERVERFACES-1758

    which is not fixed in Mojarra 2.1.x

    0 讨论(0)
  • 2020-12-06 02:52

    As long as javax.faces.PARTIAL_STATE_SAVING is set to false you'll receive that java.lang.IllegalArgumentException. If you set javax.faces.PARTIAL_STATE_SAVING to true (and you know what you are doing) you will get the "good old" javax.faces.application.ViewExpiredException back.

    0 讨论(0)
  • 2020-12-06 02:59

    In my case turned out i had missing end tag in xhtml file for one of the jstl calls. i was using choose tag and one of the when tags in between choose did not have an end tag

    0 讨论(0)
  • 2020-12-06 03:07

    This one should have been thrown as a ViewExpiredException. It's a bug which started to manifest in Mojarra 2.0.3 and is been fixed in Mojarra 2.1.0. See also issue 1762 (note that Mojarra 2.1.0 doesn't work on Tomcat/Jetty, use at least Mojarra 2.1.1 then).

    Basically, when Mojarra fails to build or restore the view, then it usually throws a specific enough exception, but due to this bug, a valid view was incorrectly been expected later in the code which in turn results in IllegalArgumentException: null source. The possible real cause would have been that the view contains a simple XML syntax error, such as a missing tag or broken attribute value, for which Mojarra would usually have thrown a FaceletException with a very detailed message with line number and position and such.

    To prevent the ViewExpiredException, you would have to refresh the page by a GET request before doing any actions on it. If you're using a Mojarra version where this bug does not manifest (e.g. 2.0.2 or older, or 2.1.0 or newer), then you could gracefully handle it with an <error-page> in web.xml on the particular exception and provide a custom error page wherein the enduser is informed that the session has been expired, along with a link to the initial request URI.

    0 讨论(0)
提交回复
热议问题