[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1995) MultipartFilter maxRequestSize exceeded throws NullPointerException from ExceptionFilter

Nathan Wray (JIRA) jira-events at lists.jboss.org
Fri Sep 28 10:59:41 EDT 2007


MultipartFilter maxRequestSize exceeded throws NullPointerException from ExceptionFilter
----------------------------------------------------------------------------------------

                 Key: JBSEAM-1995
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1995
             Project: JBoss Seam
          Issue Type: Patch
          Components: Core
    Affects Versions: 2.0.0.CR1, 2.0.0.BETA1
         Environment: WinXP, jboss-4.2.1.GA, jboss-seam-2.0.0.CR1,  Java VM: Java HotSpot(TM) Server VM 1.5.0_12-b04,Sun Microsystems Inc.
            Reporter: Nathan Wray


using the <s:fileUpload /> component, when maxRequestSize is exceed and the user is not in a conversation scope, the server throws the user a null pointer exception rather than the message configured in pages.xml:

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)

the code in ExceptionFilter at line 93 assumes a Manager will be found in the request causing a null pointer exception.
I've patched this locally (against 2.0CR1) with the following:

93,94c93
<          if (oldManager != null)
<              conversationId = oldManager.getCurrentConversationId();
---
>          conversationId = oldManager.getCurrentConversationId();
102,110c101,102
<       if (conversationId != null)
<       {
<           ConversationPropagation.instance().setConversationId(conversationId);
<           Manager.instance().restoreConversation();
<       }
<       else
<       {
<           Manager.instance().initializeTemporaryConversation();
<       }
---
>       ConversationPropagation.instance().setConversationId(conversationId);
>       Manager.instance().restoreConversation();



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list