Note that there are some explanatory texts on larger screens.

plurals
  1. POImages intercepted by Extensions Filter
    primarykey
    data
    text
    <p>I have recently ported my data and file stores to Mongodb, which I am starting to really enjoy. I have what looks like a weird problem now.</p> <p>The Files Extension Filter in Tomohawk seems to be intercepting when my app when tries to write images for the user, from GridFS. I only want the filter to support my file upload - it should not be active when the system is pushing images to the user. Any ideas on how to stop it from intercepting these files would be very helpful.</p> <p>More details:</p> <p>I use Tomohawk file upload, and have the Extensions Filter enabled in my web.xml, in order to use it. I display images in the RichFaces MediaOutput control, which provides an output stream to which you can write your media bytestream. Everything was working fine when I stored the images as files, or within MySql.</p> <p>Now I am using the GridFSDBFile writeTo: OutputStream method to write my images to the RichFaces MediaOutput control. When I try to display my images, the File Extensions Filter seems to intercept it, and then Tomcat throws a TokenMgrException.</p> <p>I only want the filter to support my file upload - it should not be active when the system is pushing images to the user. Any ideas on how to stop it from intercepting these files would be very helpful.</p> <p>Here is the error:</p> <pre><code>Oct 16, 2012 2:17:29 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/ilearn] threw exception [Servlet execution threw an exception] with root cause org.apache.tomcat.util.http.parser.TokenMgrError: Lexical error at line 1, column 1. Encountered: "{" (123), after : "" at org.apache.tomcat.util.http.parser.HttpParserTokenManager.getNextToken(HttpParserTokenManager.java:434) at org.apache.tomcat.util.http.parser.HttpParser.jj_consume_token(HttpParser.java:267) at org.apache.tomcat.util.http.parser.HttpParser.Type(HttpParser.java:64) at org.apache.tomcat.util.http.parser.HttpParser.MediaType(HttpParser.java:16) at org.apache.catalina.connector.Response.setContentType(Response.java:806) at org.apache.catalina.connector.Response.checkSpecialHeader(Response.java:1140) at org.apache.catalina.connector.Response.setHeader(Response.java:1460) at org.apache.catalina.connector.ResponseFacade.setHeader(ResponseFacade.java:535) at com.sun.faces.context.ExternalContextImpl.setResponseHeader(ExternalContextImpl.java:777) at javax.faces.context.ExternalContextWrapper.setResponseHeader(ExternalContextWrapper.java:717) at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:211) at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:125) at org.apache.myfaces.custom.captcha.CAPTCHAResourceHandlerWrapper.handleResourceRequest(CAPTCHAResourceHandlerWrapper.java:208) at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:125) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:591) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) </code></pre> <p>and here is my web.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt; &lt;display-name&gt;iLearn&lt;/display-name&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsf&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;context-param&gt; &lt;description&gt;State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2&lt;/description&gt; &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt; &lt;param-value&gt;server&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;javax.servlet.jsp.jstl.fmt.localizationContext&lt;/param-name&gt; &lt;param-value&gt;resources.application&lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt;org.jboss.weld.environment.servlet.Listener&lt;/listener-class&gt; &lt;/listener&gt; &lt;context-param&gt; &lt;param-name&gt;javax.faces.CONFIG_FILES&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/beans.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;org.richfaces.SKIN&lt;/param-name&gt; &lt;param-value&gt;ruby&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;org.richfaces.CONTROL_SKINNING&lt;/param-name&gt; &lt;param-value&gt;enable&lt;/param-value&gt; &lt;/context-param&gt; &lt;filter&gt; &lt;filter-name&gt;AccessFilter&lt;/filter-name&gt; &lt;filter-class&gt;com.iLearn.security.AccessFilter&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;AccessFilter&lt;/filter-name&gt; &lt;url-pattern&gt;/restricted/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;filter&gt; &lt;filter-name&gt;Extensions Filter&lt;/filter-name&gt; &lt;filter-class&gt;org.apache.myfaces.webapp.filter.ExtensionsFilter&lt;/filter-class&gt; &lt;init-param&gt; &lt;description&gt; Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB &lt;/description&gt; &lt;param-name&gt;uploadMaxFileSize&lt;/param-name&gt; &lt;param-value&gt;100m&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;description&gt; Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB &lt;/description&gt; &lt;param-name&gt;uploadThresholdSize&lt;/param-name&gt; &lt;param-value&gt;100k&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;description&gt; Set the path where the intermediary files will be stored. &lt;/description&gt; &lt;param-name&gt;uploadRepositoryPath&lt;/param-name&gt; &lt;param-value&gt;/iLearnData/temp/&lt;/param-value&gt; &lt;/init-param&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;Extensions Filter&lt;/filter-name&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;/filter-mapping&gt; &lt;/web-app&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload