File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes unable to understand error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "unable to understand error message" Watch "unable to understand error message" New topic
Author

unable to understand error message

amit malhotra
Ranch Hand

Joined: Aug 06, 2001
Posts: 30
i am trying to upload a file using servlets given in in a book the congifuration and all is done when i try to run the code the error i get is
An unexpected error has occoured
Error description :java.lang.StringIndexOutOfBoundsException: String index out of range: -1
could some one tell me why, it is really urgent
thanx,bye
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5288
    
  10

It might help if you try to figure out the general vicinity in your code where the exception occurs and then post that code.
Most likely, you are passing an invalid index to a String method such as substring() or charAt()
------------------
Junilu Lacar
Sun Certified Programmer for the Java� 2 Platform


Junilu - [How to Ask Questions] [How to Answer Questions]
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
And the index value that the original poster is trying to use is -1, which is invalid (needless to say).


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to understand error message