-
1. Re: NullPointerException with fileUpload
dgreenbean Jul 29, 2008 1:23 PM (in response to dgreenbean)I have also tried
<h:form> <rich:fileUpload /> </h:form>
This gives the same error. -
2. Re: NullPointerException with fileUpload
dgreenbean Jul 29, 2008 3:41 PM (in response to dgreenbean)Figured it out. This is not strictly a RichFaces issue. I had Apache MyFaces ExtensionFilter configured in web.xml in order to use Tomahawk components. All multipart/form-data requests that are passed through ExtensionFilter get converted into a MultipartRequestWrapper, which always returns "application/x-www-form-urlencoded" as the contentType. The Ajax4Jsf BaseFilter does not recognize this as a multipart form request and, therefore, does not set the necessary session variable to parse the file upload. Since the FileUploadRendererBase requires this variable, a NullPointerException is thrown.
Also, I had to get rid of Trinidad, which I wasn't using anyway.
There is hope! Putting the ExtensionsFilter declaration (and mappings) after the RichFaces Filter declaration/mappings in web.xml seems to solve the issue.
Thanks to anyone who looked into this. -
3. Re: NullPointerException with fileUpload
andrei_exadel Jul 30, 2008 4:53 AM (in response to dgreenbean)Hello. This is known issue.
You should to configure AJAX & Extension filter to be sure that AJAX filter is processing firstly.
Please look at the following issue: https://jira.jboss.org/jira/browse/RF-3096.
There example attached with correctly configured filters. It works fine with myfaces.
Look at those web.xml and keep the same filter declaration ordering and mapping.