This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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:
Have you checked out Aspose?
subject: Exception while uploading a zip file on Linux OS
jQuery in Action, 3rd edition