File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help me

 
Silly Boy
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i got error msg:
exception in thread "main" java.lang.ArrayIndexOutOfBoundException:1000
Record.Save(Record.java:238)

how to fix it ya??

[ April 06, 2005: Message edited by: Silly Boy ]
[ April 06, 2005: Message edited by: Mark Spritzler ]
 
Sudharsan Govindarajan
Ranch Hand
Posts: 319
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jeff Jetton
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Silly Boy:

i got error msg:
exception in thread "main" java.lang.NullPointerException
Record.Save(Record.java:238)

how to fix it ya??


Notice that the error message is referring to line #238, and that it's in your Save method of the Record class. Now, I don't know which line is 238 in your file, since you just posted the Save method, but once you figure that out, you're halfway there--the error will be on or near that line.

Second, the error is a NullPointerException. So head to the docs and take a look at what that means. I'm guessing that it's probably the second cause they list. So look for a case near line 238 where you're assigning something that might turn out to really be "null". It helps to ask yourself things like, "What is this line of code doing?" "Is it doing what I think it's doing?" "Are these variables and objects representing what I think they're representing?"

Third, I really didn't bother wading though your code too much because, well, it's kind of a mess. If you post your code with "CODE" tages around it, that will preserve the indenting, and make it a whole lot more readable.

Good luck ya??

- Jeff
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mr. Boy,

Welcome to JavaRanch!

You may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. "Handles" aren't acceptable. You can change your display name here. Thanks!
 
Jeff Bosch
Ranch Hand
Posts: 805
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Silly Boy" -

You have got to be kidding here. Please read the JavaRanch FAQ, where you'll find a discussion on how to ask a question, including how to include only relevant portions of your code (not the whole thing), how to tell us what error you see, what you've done to try to fix it, and to clearly ask one or two relevant questions. You'll get a lot more willing help that way.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did the error change from a NullPointerException to an ArrayIndexOutOfBoundsException.

As far the new error, maybe it is simple becausel your array does not have up to 1000 elements.

try to change



to have the "for" line say

for (x = 0; x < Record.length; x++) {

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic