I added FileUploadException to org.jboss.seam.web and modified MultipartRequest to throw
it instead of RuntimeException, but I still get a 500 error:
13:00:11,221 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw
exception
| org.jboss.seam.web.FileUploadException: Multipart request is larger than allowed size
| at
org.jboss.seam.web.MultipartRequest.<init>(MultipartRequest.java:282)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:74)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
| at
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
| at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:619)
I've added the following to pages.xml:
<exception class="org.jboss.seam.web.FileUploadException">
| <redirect view-id="/error.xhtml">
| <message>File is too big</message>
| </redirect>
| </exception>
I have another exception handler that works just fine. When it occurs first, I see a debug
message from org.jboss.seam.core.Exceptions that it is reading pages.xml, but I do NOT get
that message when FileUploadException gets thrown first. Somehow, it seems like the
ExceptionFilter is not in the filter chain that MultipartFilter is in. Isn't it
supposed to be installed automatically, or is that just in 5.0? I certainly didn't add
ExceptionFilter to web.xml to get it working for the exception that we have working, and I
didn't have to add MultipartFilter to web.xml to get file uploads to work. However,
just in case, I tried adding the following to web.xml after the Seam Filter filter-mapping
tag:
<filter>
| <filter-name>Seam Exception Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
| </filter>
| <filter-mapping>
| <filter-name>Seam Exception Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <filter>
| <filter-name>Seam Multipart Filter</filter-name>
| <filter-class>org.jboss.seam.web.MultipartFilter</filter-class>
| </filter>
| <filter-mapping>
| <filter-name>Seam Multipart Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
Still no love. I can't get the ExceptionFilter to engage in exceptions from
MultipartFilter. What am I missing?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101967#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...