commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Priest" <Robert.Pri...@bentley.com>
Subject RE: FileUpload\Windows 2003 Server\Tomcat
Date Thu, 04 Nov 2004 16:43:24 GMT
By the way, what is the point of the following if statement in the dump
method?:

       int i;
        for (i=0; i<head; i++)
           logger.debug(" ");
       logger.debug("h");
        for (i=0; i<tail; i++)
            logger.debug(" ");
        logger.debug("t"); 



what is the point of dumping out a bunch of spaces that represent the
count of the head or tail?
-----Original Message-----
From: Robert Priest 
Sent: Thursday, November 04, 2004 11:38 AM
To: Jakarta Commons Users List
Subject: RE: FileUpload\Windows 2003 Server\Tomcat

Okay. It this is still happening sporadically, but here is what is left
in the buffer.
I added a few debug statements to the MultipartStream.java and
FileUploadBase.java and I am using the dump() method that was commented
out. here is what I see (this all happens when the condition bytesRead
== -1, occurs in MultipartStream.java. If you search for "The last pad
amount is left in the buffer.", you can see where the
MalformedStreamException is being thrown). In addition, the second time
I tried to load this e:



Multipart Stream created!; Time:2004-11-04 11:35:30 File Name:null File
Name:null File Name:C:\SharePoint Developer Installation Cookbook
(2).doc Error Happening (The last pad amount is left in the buffer
[bytesRead ==
-1]):
keepRegion=49;bytesRead=-1;pad=49;head=0;tail=1515;total=389637;done=fal
se
Dumping the buffer...
01234567890
                               !!-----------4FD67
          D o c u m e n t S u m m a r y I n f o r m a t i o n
8                                                           C o m
p O b j                                                  
q

   !      	            F   Microsoft Office Word Document !
MSWordDoc    Word.Document.8  9 q
!!-----------4FD67                         
     !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  0
1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?  @  A  B
C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T
U  V  W  X  Y  Z  [  \  ]  ^  _  `  a  b  c  d  e  f
g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x
y  z  {  |  }  ~                                   
                                                   
                                                   
                                                   
                                                   
                                                   
                                                   
                                            
  !
  !                              
         !  "  #  $  %  &  '  (  )  *  +  ,  -  .
/  0  1  2  3  4  5  6  7  8  9  :  ;  <  =  >  ?  @
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R
S  T  U  V  W  X  Y  Z  [  \  ]  ^  _  `  a  b  c  d
e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v
w  x  y  z  {  |  }  ~                             
                                                   
                                                   
                                                   
                                                    
                                                    
                               
                                              R o o t   E n t r y
            	            F             c4              D a
t a                                                         ! 
!   qD     1 T a b l e
                                                  3      W o r d
D o c u m e n t                                             
4@       S u m m a r y I n f o r m a t i o n
(                     
h
 
 
-----Original Message-----
From: Robert Priest
Sent: Thursday, October 28, 2004 3:17 PM
To: Jakarta Commons Users List
Subject: RE: FileUpload\Windows 2003 Server\Tomcat

I guess in that respect, it is similar to bug:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25598

but I am running Justin Sampson's patch of:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=30061

but it doesn't work for this problem. Possibly this problem, is more
related to 

IIS 6.0 on Windows 2003 Server?


Here is the JUNIT Output from when I built the fileupload jar today.
They complete successfully:

internal-test:
    [junit] Running org.apache.commons.fileupload.DefaultFileItemTest
    [junit] Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 0.296
sec
    [junit] Testsuite: org.apache.commons.fileupload.DefaultFileItemTest
    [junit] Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 0.296
sec

    [junit] Testcase: testTextFieldConstruction took 0 sec
    [junit] Testcase: testFileFieldConstruction took 0 sec
    [junit] Testcase: testBelowThreshold took 0.016 sec
    [junit] Testcase: testAboveThresholdDefaultRepository took 0 sec
    [junit] Testcase: testAboveThresholdSpecifiedRepository took 0 sec
    [junit] Testcase: testContentCharSet took 0.015 sec
    [junit] Running org.apache.commons.fileupload.FileUploadTest
    [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.312
sec
    [junit] Testsuite: org.apache.commons.fileupload.FileUploadTest
    [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.312
sec

    [junit] Testcase: testWithInvalidRequest took 0.047 sec
    [junit] Testcase: testWithNullContentType took 0 sec
    [junit] Testcase: testFileUpload took 0.015 sec
    [junit] Testcase: testEmptyFile took 0 sec
    [junit] Testcase: testIE5MacBug took 0 sec
    [junit] Running org.apache.commons.fileupload.MultipartStreamTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.266
sec
    [junit] Testsuite: org.apache.commons.fileupload.MultipartStreamTest
    [junit] Tests run: 4, Failures: 0, Errors: 0, Time elapsed: 0.266
sec

    [junit] Testcase: testDefaultConstructor took 0.016 sec
    [junit] Testcase: testThreeParamConstructor took 0 sec
    [junit] Testcase: testTwoParamConstructor took 0 sec
    [junit] Testcase: testToString took 0 sec
    [junit] Running org.apache.commons.fileupload.ParameterParserTest
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.265
sec
    [junit] Testsuite: org.apache.commons.fileupload.ParameterParserTest
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 0.265
sec

    [junit] Testcase: testParsing took 0 sec
    [junit] Testcase: testContentTypeParsing took 0 sec
    [junit] Testcase: testParsingEscapedChars took 0 sec



-----Original Message-----
From: Robert Priest
Sent: Thursday, October 28, 2004 2:13 PM
To: Jakarta Commons Users List; Dakota Jack
Subject: RE: FileUpload\Windows 2003 Server\Tomcat

looks like the else statement here in: MultipartStream.java is
occurring.
(from MutipartStream.readBodyData(OutputStream output)):


 		bytesRead = input.read(buffer, pad, bufSize - pad);

                // [pprrrrrrr]
                if (bytesRead != -1)
                {
                    tail = pad + bytesRead;
                }
                else
                {
                    // The last pad amount is left in the buffer.
                    // Boundary can't be in there so write out the
                    // data you have and signal an error condition.
                    output.write(buffer, 0, pad);
                    output.flush();
                    total += pad;
                    throw new MalformedStreamException(
                            "Stream ended unexpectedly");
                }


Here it is the stack trace:



13:43:32,962,ERROR: FileUploadBase  FileUploadBase e.getMessage() =
Stream ended unexpectedly
org.apache.commons.fileupload.MultipartStream$MalformedStreamException:
Stream ended unexpectedly
	at
org.apache.commons.fileupload.MultipartStream.readBodyData(MultipartStre
am.java:552)
	at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase
.java:360)
	at
com.projectwise.web.server.lite.formhandler.FormHandler.arrangeRequest(F
ormHandler.java:655)
	at
com.projectwise.web.server.lite.formhandler.FormHandler.processRequest(F
ormHandler.java:3856)
	at
com.projectwise.web.server.lite.LiteServlet.doGet(LiteServlet.java:470)
	at
com.projectwise.web.server.lite.LiteServlet.doPost(LiteServlet.java:527)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:260)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:235
0)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
	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.i
nvokeNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
80)
	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:256)
	at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:361)
	at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:565)
	at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
537)
	at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:640)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:533)
	at java.lang.Thread.run(Thread.java:536) 

-----Original Message-----
From: Dakota Jack [mailto:crackwillow@gmail.com]
Sent: Thursday, October 28, 2004 12:10 PM
To: Jakarta Commons Users List
Subject: Re: FileUpload\Windows 2003 Server\Tomcat

I would suggest that you go into FileUploadBase and flesh out the
exceptions so that you can get more information.  Try something like the
following:


/*
    try {*/
      int boundaryIndex = contentType.indexOf("boundary=");
      if (boundaryIndex < 0) {
        throw new FileUploadException(
            "the request was rejected because "
            + "no multipart boundary was found");
      }
      byte[] boundary = contentType.substring(
          boundaryIndex + 9).getBytes();

    InputStream input = null;
    MultipartStream multi = null;
    boolean nextPart = false;

    try {
      input = req.getInputStream();
      multi = new MultipartStream(input, boundary);
      multi.setHeaderEncoding(headerEncoding);
      nextPart = multi.skipPreamble();
    } catch(IOException ioe) {
      YOURLOGGER("log.error","FileUploadBase (88) ioe.getMessage() = "
+ ioe.getMessage());
    }
      while (nextPart) {
        Map headers = null;

        try {
          headers = parseHeaders(multi.readHeaders());
        } catch (MalformedStreamException mse) {
          YOURLOGGER("log.error","FileUploadBase mse.getMessage() = "
+ mse.getMessage());
        }

        String fieldName = getFieldName(headers);
        if (fieldName != null) {
          String subContentType = getHeader(headers, CONTENT_TYPE);
          if (subContentType != null &&
subContentType.startsWith(MULTIPART_MIXED)) {
            // Multiple files.
            byte[] subBoundary =
              subContentType.substring(
                subContentType
                .indexOf("boundary=") + 9).getBytes();
            boolean nextSubPart = false;
            try {
              multi.setBoundary(subBoundary);
              nextSubPart =multi.skipPreamble();
            } catch (MalformedStreamException mse) {
              YOURLOGGER("log.error","FileUploadBase mse.getMessage() =
" + mse.getMessage());
            } catch (IllegalBoundaryException ibe) {
              YOURLOGGER("log.error","FileUploadBase ibe.getMessage() =
" + ibe.getMessage());
            } catch (IOException ioe) {
              YOURLOGGER("log.error","FileUploadBase ioe.getMessage() =
" + ioe.getMessage());
            }

            while (nextSubPart) {
              try {
                headers = parseHeaders(multi.readHeaders());
              } catch (MalformedStreamException mse) {
                YOURLOGGER("log.error","FileUploadBase
mse.getMessage() = " + mse.getMessage());
              }
              if (getFileName(headers) != null) {
                FileItem item =
                    createItem(headers, false);
                OutputStream os = null;

                try {
                  os = item.getOutputStream();
                  multi.readBodyData(os);
                } catch (IOException ioe) {
                  YOURLOGGER("log.error","FileUploadBase
ioe.getMessage() = " + ioe.getMessage());
                } finally {
                  try {
                    os.close();
                  } catch (IOException ioe) {
                    YOURLOGGER("log.error","FileUploadBase
ioe.getMessage() = " + ioe.getMessage());
                  }
                }
                items.add(item);
              } else {
                // Ignore anything but files inside
                // multipart/mixed.
                try {
                  multi.discardBodyData();
                } catch (MalformedStreamException mse) {
                  YOURLOGGER("log.error","FileUploadBase
mse.getMessage() = " + mse.getMessage());
                } catch (IOException ioe) {
                  YOURLOGGER("log.error","FileUploadBase
ioe.getMessage() = " + ioe.getMessage());
                }
              }
              try {
                nextSubPart = multi.readBoundary();
              } catch (MalformedStreamException mse) {
                YOURLOGGER("log.error","FileUploadBase
mse.getMessage() = " + mse.getMessage());
              }
            }
            try {
              multi.setBoundary(boundary);
            } catch (IllegalBoundaryException ibe) {
              YOURLOGGER("log.error","FileUploadBase ibe.getMessage() =
" + ibe.getMessage());
            }
          } else {
            if (getFileName(headers) != null) {
              // A single file.
              FileItem item = createItem(headers, false);
              OutputStream os = null;
              try {
                os = item.getOutputStream();
                multi.readBodyData(os);
              } catch (IOException ioe) {
                YOURLOGGER("log.error","FileUploadBase
ioe.getMessage() = " + ioe.getMessage());
              } finally {
                try {
                  os.close();
                } catch(IOException ioe) {
                  YOURLOGGER("log.error","FileUploadBase
ioe.getMessage() = " + ioe.getMessage());
                }
              }
              items.add(item);
            } else {
              // A form field.
              FileItem item = createItem(headers, true);
              OutputStream os = null;
              try {
                os = item.getOutputStream();
                multi.readBodyData(os);
              } catch(IOException ioe) {
                YOURLOGGER("log.error","FileUploadBase
ioe.getMessage() = " + ioe.getMessage());
              } finally {
                try {
                  os.close();
                } catch (IOException ioe) {
                  YOURLOGGER("log.error","FileUploadBase
ioe.getMessage() = " + ioe.getMessage());
                }
              }
              items.add(item);
            }
          }
        } else {
          // Skip this part.
          try {
            multi.discardBodyData();
          } catch (MalformedStreamException mse) {
            YOURLOGGER("log.error","FileUploadBase mse.getMessage() = "
+ mse.getMessage());
          } catch (IOException ioe) {
            YOURLOGGER("log.error","FileUploadBase ioe.getMessage() = "
+ ioe.getMessage());
          }
        }

        try {
          nextPart = multi.readBoundary();
        } catch (MalformedStreamException mse) {
          YOURLOGGER("log.error","FileUploadBase mse.getMessage() = "
+ mse.getMessage());
        }
      }
      /*
    } catch (IOException e) {
      throw new FileUploadException(
        "Processing of " + MULTIPART_FORM_DATA
          + " request failed. " + e.getMessage());
    }*/

Seem right?

Jack


On Thu, 28 Oct 2004 10:30:13 -0400, Robert Priest
<robert.priest@bentley.com> wrote:
>  Hello Dakota Jack,
> 
> I am using the latest version of fileupload 
> (commons-fileupload-1.1-dev.jar), which is using the latest version of

> commons-io-1.1-dev.jar
> 
> The code for getTempFile() in the latest version of DefaultFileItem, 
> looks like this:
> 
> /**
>      * Creates and returns a {@link java.io.File File} representing a 
> uniquely
>      * named temporary file in the configured repository path. The 
> lifetime of
>      * the file is tied to the lifetime of the <code>FileItem</code> 
> instance;
>      * the file will be deleted when the instance is garbage
collected.
>      *
>      * @return The {@link java.io.File File} to be used for temporary 
> storage.
>      */
>     protected File getTempFile()
>     {
>         File tempDir = repository;
>         if (tempDir == null)
>         {
>             tempDir = new File(System.getProperty("java.io.tmpdir"));
>         }
> 
>         String fileName = "upload_" + getUniqueId() + ".tmp";
> 
>         File f = new File(tempDir, fileName);
>         FileCleaner.track(f, this);
>         return f;
>     }
> 
> That FileCleaner, is out of commons-io-1.1-dev.jar.
> 
> I think you may be on to something with the point about the threshold.
> Another point about this problem is that if the file is 51KB or less, 
> it works fine.
> However, If I try it with a file of 52 KB or more, it fails. Any idea?
> 
> I did check the tmpdir, and it has been created.
> Indeed, the 51 KB file is uploaded correctly to the exact same 
> directory.
> 
> However 52 KB, fails.
> 
> Here is how I call upload:
> 
>                           // Create a new file upload handler
>                     DiskFileUpload upload = new DiskFileUpload();
>                     // Set upload parameters
>                     upload.setSizeMax(-1); //no limit
>                     upload.setSizeThreshold(4096);
>                     upload.setRepositoryPath(importDir);
>                     upload.setHeaderEncoding("UTF-8");
>                     // Parse the request
>                     List items = null;
>                     try
>                         {
>                         items = upload.parseRequest(hsrRequest);
>                         }
>                     catch(Exception e)
>                         {
>                         mLog.log("Encountered Situation parsing file 
> upload request",LogConstants.LEVEL_ERROR,e);
>                         }
> 
> And here is the stack trace I get back when it fails (when filesize >
> 51
> KB)
> 
> 
> 
> NDC:
> Category:       com.projectwise.web.server.lite.LiteServlet
> Message:                Encountered Situation parsing file upload
> request
> Location:
> Thrown:
> org.apache.commons.fileupload.FileUploadException: Processing of 
> multipart/form-data request failed. Stream ended unexpectedly
>         at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBa
> se
> .java:364)
>         at
> com.projectwise.web.server.lite.formhandler.FormHandler.arrangeRequest
> (F
> ormHandler.java:655)
>         at
> com.projectwise.web.server.lite.formhandler.FormHandler.processRequest
> (F
> ormHandler.java:3856)
>         at
>
com.projectwise.web.server.lite.LiteServlet.doGet(LiteServlet.java:470)
>         at
>
com.projectwise.web.server.lite.LiteServlet.doPost(LiteServlet.java:527)
>         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> ca
> tionFilterChain.java:247)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lt
> erChain.java:193)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
> lv
> e.java:260)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext
> .i
> nvokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
> :4
> 80)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
> lv
> e.java:191)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext
> .i
> nvokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
> :4
> 80)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2
> 35
> 0)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
> va
> :180)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext
> .i
> nvokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcher
> Va
> lve.java:170)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext
> .i
> nvokeNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
> va
> :171)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext
> .i
> nvokeNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
> :4
> 80)
>         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
> .i
> nvokeNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
> :4
> 80)
>         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:256)
>         at
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:361)
>         at
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:565)
>         at
>
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:
> 537)
>         at
> org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:640)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPo
> ol
> .java:533)
>         at java.lang.Thread.run(Thread.java:536)
> 
> 
> 
> 
> -----Original Message-----
> From: Dakota Jack [mailto:crackwillow@gmail.com]
> Sent: Wednesday, October 27, 2004 7:53 PM
> To: Jakarta Commons Users List
> Subject: Re: FileUpload\Windows 2003 Server\Tomcat
> 
> What is your code for his, Robert?  And, what is the stack trace of 
> the error?  It looks like the problem is in OutputStream os = 
> item.getOutputStream();  and this goes back to
> 
>     protected File getTempFile()
>     {
>         File tempDir = repository;
>         if (tempDir == null)
>         {
>             tempDir = new File(System.getProperty("java.io.tmpdir"));
>         }
> 
>         String fileName = "upload_" + getUniqueId() + ".tmp";
> 
>         File f = new File(tempDir, fileName);
>         f.deleteOnExit();
>         return f;
>     }
> 
> Have you checked out your temporary directory?  Or, I think there is 
> something about the threshold only being used for certain things.
> 
> Jack
> 
> On Wed, 27 Oct 2004 18:01:11 -0400, Robert Priest 
> <robert.priest@bentley.com> wrote:
> > Hello, I am running a version of tomcat 4.1 on Windows 2003 Server 
> > and
> 
> > I keep getting the following problem from the
> >
> > DiskFileUpload.parseRequest() call:
> >
> > Date:                   Wed Oct 27 17:23:18 EDT 2004 (1098912198367)
> > Thread:         Thread-11
> > Message #:      274
> > Level:          ERROR
> > NDC:
> > Category:       com.projectwise.web.server.lite.LiteServlet
> > Message:                Encountered Situation parsing file upload
> > request
> > Location:
> > Thrown:
> > org.apache.commons.fileupload.FileUploadException: Processing of 
> > multipart/form-data request failed. Stream ended unexpectedly
> >         at
> > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUpload
> > Ba
> > se
> > .java:364)
> >         at
> > com.projectwise.web.server.lite.formhandler.FormHandler.arrangeReque
> > st
> > (F
> > ormHandler.java:655)
> >         ...
> >
> > This code works fine on other machines (w2k, XP, etc). I am only 
> > seeing this when I am running on a Windows 2003 Server.
> >
> > It seems to happen when on
> >
> > FileUploadBase line:349
> >
> >                finally
> >                         {
> >      line 349: -->     os.close();
> >                         }
> >
> > the original exception is a
> >
> > org.apache.commons.fileupload.MultipartStream$MalformedStreamExcepti
> > on
> > "Stream ended unexpectedly"
> >
> > is anyone else seeing this issue?
> >
> > I am using a version of fileupload which  I compiled today from the 
> > cvs repository.
> >
> > it is:  commons-fileupload-1.1-dev.jar
> >
> > Does anyone have any suggestions?
> >
> > I would appreciate the help. Thanks.
> >
> > Robert.
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: 
> > commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> > commons-user-help@jakarta.apache.org
> >
> >
> 
> --
> "You can't wake a person who is pretending to be asleep."
> 
> ~Native Proverb~
> 
> "Each man is good in His sight. It is not necessary for eagles to be 
> crows."
> 
> ~Hunkesni (Sitting Bull), Hunkpapa Sioux~
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> 
> 
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


--
"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be
crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message