7 Replies Latest reply on Nov 24, 2010 9:55 AM by calebejv

    Fileupload fails randomly

    ysawant

      I am using seam fileupload. In the development machine everything works fine but when I deploy it on linux server fileupload fails randomly. This is nothing to do with file size because it also fails for small files for example it even fails for a file of size 39kb. I am using fileupload to uploading images. The most strange thing is when I am trying to upload an image say test.jpg from home ( NON-LINUX PLATFORM) then the image is uploaded successfully but when I try to upload the same image from my company network it fails. Can someone please help me out to understand how any network can affect uploading of file? the error that I am getting on the server where an application has been hosted is as given below:


      org.jboss.seam.web.FileUploadException: IO Error parsing multipart request
              at org.jboss.seam.web.MultipartRequestImpl.parseRequest(MultipartRequestImpl.java:444)
              at org.jboss.seam.web.MultipartRequestImpl.getParameterNames(MultipartRequestImpl.java:530)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:84)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: java.net.SocketTimeoutException: Read timed out
              at java.net.SocketInputStream.socketRead0(Native Method)
              at java.net.SocketInputStream.read(SocketInputStream.java:129)
              at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:716)
              at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:746)
              at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)
              at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:675)
              at org.apache.coyote.Request.doRead(Request.java:428)
              at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:297)
              at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)
              at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:312)
              at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)
              at org.jboss.seam.web.MultipartRequestImpl.parseRequest(MultipartRequestImpl.java:424)


      -----------------------------------------------------------
      Please provide any workaround or solution using which I can solve this problem. This is a showstopper for us.
      -----------------------------------------------------------

        • 1. Re: Fileupload fails randomly
          calebejv

          Hello yuvraj


          I've had a similar problem in the past with the multipart filter.


          Send us the components.xml / source and xhtml page. Its difficult to find out without the sources.


          Try inserting the multi-part filter create temp files on the components.xml.

          <web:multipart-filter max-request-size="6242880"  create-temp-files="true" />



          Best Regards

          • 2. Re: Fileupload fails randomly
            ysawant
            Adding <web:multipart-filter max-request-size="6242880" create-temp-files="true" /> didn't help. I am still not able to upload few images from my company environment. I tried uploading images from home on my server and there it works fine. things other than file upload work good.

            I will add my files today so that you can take a look at these.
            • 3. Re: Fileupload fails randomly
              calebejv

              Ok


              I'll be waiting.


              One other thing, there is a proxy between your clients and server inside your company environment ?


              This maybe a source of problems with file uploads.


              Send your App server and Seam versions.


              Best Regards

              • 4. Re: Fileupload fails randomly
                ysawant
                ------------------------------------------------------------------------------------------
                components.xml file
                ------------------------------------------------------------------------------------------
                <?xml version="1.0" encoding="UTF-8"?>
                <components xmlns="http://jboss.com/products/seam/components"
                     xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence"
                     xmlns:drools="http://jboss.com/products/seam/drools" xmlns:bpm="http://jboss.com/products/seam/bpm"
                     xmlns:security="http://jboss.com/products/seam/security" xmlns:mail="http://jboss.com/products/seam/mail"
                     xmlns:web="http://jboss.com/products/seam/web" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                                 http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
                     <core:init debug="@debug@" jndi-pattern="@jndiPattern@" />
                     <core:manager concurrent-request-timeout="5000"
                          conversation-timeout="180000" conversation-id-parameter="cid"
                          parent-conversation-id-parameter="pid" />
                     <web:multipart-filter max-request-size="6242880"
                          create-temp-files="true" />
                     <web:context-filter  url-pattern="/gallery/*" />
                     <!--
                          Make sure this URL pattern is the same as that used by the Faces
                          Servlet
                     -->
                     <web:rewrite-filter />
                     <web:hot-deploy-filter url-pattern="*.seam" />
                     <persistence:managed-persistence-context
                          name="entityManager" auto-create="true" persistence-unit-jndi-name="@puJndiName@" />
                     <drools:rule-base name="securityRules">
                      <drools:rule-files>
                         <value>/security.drl</value>
                      </drools:rule-files>
                   </drools:rule-base>
                     <security:rule-based-permission-resolver
                          security-rules="#{securityRules}" />
                     <security:identity authenticate-method="#{authenticator.authenticate}"
                          remember-me="true" />
                     <event type="org.jboss.seam.security.notLoggedIn">
                          <action execute="#{redirect.captureCurrentView}" />
                     </event>
                     <event type="org.jboss.seam.security.loginSuccessful">
                          <action execute="#{redirect.returnToCapturedView}" />
                     </event>
                     <mail:mail-session host="localhost" port="25" />

                   <!-- For use with jBPM pageflow or process management -->
                     <!--
                          <bpm:jbpm> <bpm:process-definitions></bpm:process-definitions>
                          <bpm:pageflow-definitions></bpm:pageflow-definitions> </bpm:jbpm>
                     -->
                </components>
                ------------------------------------------------------------------------------------
                • 5. Re: Fileupload fails randomly
                  ysawant

                  Application Server: JBoss 4.2.3
                  Seam Version: 2.1.2

                  • 6. Re: Fileupload fails randomly
                    ysawant

                    Ooh, under my Browser Connection Setting I have Use system proxy settings selected. I will try by selecting it to No proxy tomorrow and get back on this. In the mean time if any correction is required in component.xml file then please let me know. I will make that correction and try that too.


                    Under the components.xml file i have changed  concurrent-request-timeout to 5000 from 500
                    and conversation-timeout from 120000 to 180000 and still have to try it out. I will get back on this with my observation.

                    • 7. Re: Fileupload fails randomly
                      calebejv

                      Please post the xhtml and sources of the caller block for fileupload


                      It will be easier to track down the error.


                      Best Regards