This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 4442
    
    5

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
 
Consider Paul's rocket mass heater.
 
subject: unable to understand error message
 
Similar Threads
i have a Errors in Hibernate Query
Encapsulation and getter&setter methods
ServletContext
File not found error
Tomcat & MS Active Directory