File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Exception while uploading a zip file on Linux OS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Exception while uploading a zip file on Linux OS" Watch "Exception while uploading a zip file on Linux OS" New topic

Exception while uploading a zip file on Linux OS

Anutosh Swamy
Ranch Hand

Joined: Sep 20, 2007
Posts: 30

Hi All,

I am getting an exception of

java.lang.IndexOutOfBoundsException Method)

when I try uploading a ZIP file through my application running on Linux OS but the same is running fine on Windows OS (without any exception and uploading perfectly) kindly let me know where the code is wrong or I need to make some changes accordingly while making this run perfectly on Linux OS

Here's my Servlet code for uploading the Zip file:


Thank you in Advance

K. Anutosh<br /> <br />SCJP 1.4<br />SCWCD 1.4<br />OCA (Paper I)
Nitin Pathak
Ranch Hand

Joined: Sep 25, 2006
Posts: 70
There seems to be the problem with the length argument (endPos - startPos) of write(). As the exception clearly suggests, the code is trying to access the memory location outside the already-rigidly-assigned space.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Oh no, not again that ripoff.

Please read my answer in this topic:
I agree. Here's the link:
subject: Exception while uploading a zip file on Linux OS
It's not a secret anymore!