1 Reply Latest reply on Oct 20, 2006 1:31 PM by gimbal2

    upload file problem

    843838
      hi......
      i am using struts.....
      i want to upload a file from client to server......but i am using enctype="multipart/form-data" in my jsp........it prompt out a err message

      javax.servlet.ServletException: Servlet execution threw an exception
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:275)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at com.entertainment.system.EntertainmentFilter.doFilter(EntertainmentFilter.java:70)
           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.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
           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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
           at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
           at java.lang.Thread.run(Thread.java:595)

      please help.....thank you
        • 1. Re: upload file problem
          gimbal2
          at com.entertainment.system.EntertainmentFilter.doFilter(EntertainmentFilter.java:70)
          That is your own filter I'm assuming and line 70 of that filter is causing your exception. So check out that line to see what the offending code is.

          I'm guessing that line does something with a parameter you retrieved, which is most likely null. A multipart form requires an API that can parse a multipart request, you cannot get file uploads (or other multipart fields) using the HttpServletRequest. I suggest you try out Apache commons FileUpload.

          http://jakarta.apache.org/commons/fileupload/