commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: org/apache/commons/io/output/DeferredFileOutputStream
Date Mon, 12 Jun 2006 15:56:29 GMT
My guess is that you're using Commons FileUpload 1.1, but you don't have
Commons IO included in your web app. Make sure Commons IO is in your
WEB-INF/lib, alongside Commons FileUpload, and you should be OK.

--
Martin Cooper


On 6/12/06, Oliver Enders <OEnders@a-tec.de> wrote:
>
>
>
>
>
> Hy List,
>
>
>
> I´ve got the following problem:
>
>
>
> I´m trying to upload a file using the following jsp-code:
>
>
>
> <form name="HandleTR" action="HandleTestRequest.jsp" method="post"
> enctype="multipart/form-data">
>
>        <tr><td colspan="3" height="10"></td></tr>
>
>          <tr class="zeile_ungerade"><td class="standardLabel">Test request
> title:</td>
>
>              <td colspan="2"  class="standardLabel"><input type="text"
> size="55" name="tr_desc" value=""></td>
>
>          </tr>
>
>           <tr class="zeile_ungerade"><td class="standardLabel">Test
> request file:</td>
>
>              <td colspan="2"  class="standardLabel"><input type="file"
> name="uplfile"></td>
>
>          </tr>
>
>          <tr class="zeile_gerade"><td class="standardLabel"
> colspan="3">Definition (description):</td></tr>
>
>          <tr class="zeile_gerade"><td colspan="3"
> class="standardLabel"><textarea name="tr_def" rows="5"
> cols="110"></textarea></td></tr>
>
>          <tr><td><input type="submit" value="Speichern"></td></tr>
>
>
>
>
>
>        <input type="hidden" name="flf" value="0">
>
>        <input type="hidden" name="m" value="<%=m%>">
>
>     </form>
>
>
>
> Then the receiving Page does this:
>
>
>
> boolean isMultipart = ServletFileUpload.isMultipartContent(request);
>
> String dateiName = "";
>
> String uploadDir = "C:/";
>
> try{
>
>   if(FileUpload.isMultipartContent(request)) {
>
>     DiskFileUpload upload = new DiskFileUpload();
>
>     List items = upload.parseRequest(request);
>
>     Iterator iter = items.iterator();
>
>     while (iter.hasNext()) {
>
>
>
>       FileItem item = (FileItem) iter.next();
>
>       dateiName=item.getName().toString();
>
>       if(dateiName.lastIndexOf("\\")>=0) {
>
>
>
>          dateiName = dateiName.substring(dateiName.lastIndexOf("\\")+1);
>
>
>
>       }
>
>
>
>
>
>       if (true) {
>
>
>
>         File uploadedFile = new File(uploadDir+"/"+dateiName);
>
>
>
>         item.write(uploadedFile);
>
>
>
>       } else {
>
>
>
>         InputStream uploadedStream = item.getInputStream();
>
>
>
>         uploadedStream.close();
>
>
>
>       }
>
>   }
>
> }
>
> } catch (Exception ex1){
>
>   ex1.printStackTrace();
>
> }
>
>
>
> I get the following error Message:
>
>
>
> org.apache.jasper.JasperException:
> org/apache/commons/io/output/DeferredFileOutputStream
>
>             at org.apache.jasper.servlet.JspServletWrapper.service(
> JspServletWrapper.java:254)
>
>             at org.apache.jasper.servlet.JspServlet.serviceJspFile(
> JspServlet.java:295)
>
>             at org.apache.jasper.servlet.JspServlet.service(
> JspServlet.java:241)
>
>             at javax.servlet.http.HttpServlet.service(HttpServlet.java
> :853)
>
>             at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:247)
>
>             at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:193)
>
>             at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:256)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:191)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.catalina.core.StandardContext.invoke(
> StandardContext.java:2416)
>
>             at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:180)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.valves.ErrorDispatcherValve.invoke(
> ErrorDispatcherValve.java:171)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:641)
>
>             at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:172)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:641)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:174)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.coyote.tomcat4.CoyoteAdapter.service(
> CoyoteAdapter.java:223)
>
>             at org.apache.jk.server.JkCoyoteHandler.invoke(
> JkCoyoteHandler.java:263)
>
>             at org.apache.jk.common.HandlerRequest.invoke(
> HandlerRequest.java:360)
>
>             at org.apache.jk.common.ChannelSocket.invoke(
> ChannelSocket.java:604)
>
>             at org.apache.jk.common.ChannelSocket.processConnection(
> ChannelSocket.java:562)
>
>             at org.apache.jk.common.SocketConnection.runIt(
> ChannelSocket.java:679)
>
>             at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:619)
>
>             at java.lang.Thread.run(Thread.java:534)
>
> ----- Root Cause -----
>
> javax.servlet.ServletException:
> org/apache/commons/io/output/DeferredFileOutputStream
>
>             at
> org.apache.jasper.runtime.PageContextImpl.handlePageException(
> PageContextImpl.java:536)
>
>             at org.apache.jsp.HandleTestRequest_jsp._jspService
> (HandleTestRequest_jsp.java:246)
>
>             at org.apache.jasper.runtime.HttpJspBase.service(
> HttpJspBase.java:137)
>
>             at javax.servlet.http.HttpServlet.service(HttpServlet.java
> :853)
>
>             at org.apache.jasper.servlet.JspServletWrapper.service(
> JspServletWrapper.java:210)
>
>             at org.apache.jasper.servlet.JspServlet.serviceJspFile(
> JspServlet.java:295)
>
>             at org.apache.jasper.servlet.JspServlet.service(
> JspServlet.java:241)
>
>             at javax.servlet.http.HttpServlet.service(HttpServlet.java
> :853)
>
>             at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:247)
>
>             at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:193)
>
>             at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:256)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:191)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.catalina.core.StandardContext.invoke(
> StandardContext.java:2416)
>
>             at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:180)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.valves.ErrorDispatcherValve.invoke(
> ErrorDispatcherValve.java:171)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:641)
>
>             at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:172)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:641)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:174)
>
>             at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
> (StandardPipeline.java:643)
>
>             at org.apache.catalina.core.StandardPipeline.invoke(
> StandardPipeline.java:480)
>
>             at org.apache.catalina.core.ContainerBase.invoke(
> ContainerBase.java:995)
>
>             at org.apache.coyote.tomcat4.CoyoteAdapter.service(
> CoyoteAdapter.java:223)
>
>             at org.apache.jk.server.JkCoyoteHandler.invoke(
> JkCoyoteHandler.java:263)
>
>             at org.apache.jk.common.HandlerRequest.invoke(
> HandlerRequest.java:360)
>
>             at org.apache.jk.common.ChannelSocket.invoke(
> ChannelSocket.java:604)
>
>             at org.apache.jk.common.ChannelSocket.processConnection(
> ChannelSocket.java:562)
>
>             at org.apache.jk.common.SocketConnection.runIt(
> ChannelSocket.java:679)
>
>             at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:619)
>
>             at java.lang.Thread.run(Thread.java:534)
>
>
>
> Any Ideas ? Can Anybody help me ?
>
>
>
> Thanx in advance
>
> Oliver
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message