0 Replies Latest reply on Oct 4, 2007 3:14 PM by Nathan Wray

    MultipartFilter - exception redirect missed when maxsize exc

    Nathan Wray Newbie

      Hi, I'm using the file upload tag s:fileUpload and org.jboss.seam.web.MultipartFilter in a seam 2.0.0CR1 project. I have a maxRequestSize configured in components.xml:

       <component class="org.jboss.seam.web.MultipartFilter">
       <property name="createTempFiles">false</property>
       <property name="maxRequestSize">41943040</property>
       </component>
      



      and in pages.xml I have the following:

      <exception class="org.jboss.seam.web.FileUploadException">
       <redirect view-id="/main.xhtml">
       <message severity="error">File upload failed, probably because the file is too large</message>
       </redirect>
       </exception>


      When I upload a file larger than the max size, I see a debug page with the following stack trace:

      2007-09-28 10:24:40,703 ERROR [org.jboss.seam.web.ExceptionFilter] handling uncaught exception
      org.jboss.seam.web.FileUploadException: Multipart request is larger than allowed size
      at org.jboss.seam.web.MultipartRequest.<init>(MultipartRequest.java:280)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:80)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      [...]
      2007-09-28 10:24:40,703 ERROR [org.jboss.seam.web.ExceptionFilter] exception root cause
      2007-09-28 10:24:40,718 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/set].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NullPointerException
      at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:93)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
      


      rather than seeing main.seam with the expected message, as configured in pages.xml. Following the stack trace back it seems that ExceptionFilter at line 93 assumes a Manager will be found in the request. When the Manager comes back null we get the NPE. I created a patch I'm using locally that handles the missing Manager, attached to Jira 1995:

      http://jira.jboss.com/jira/browse/JBSEAM-1995

      Am I seeing this due to some underlying misconfiguration on my side or is this a bug? I created the Jira last week but no feedback as of yet.

      thanks
      Nathan