File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes writeRecord Errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "writeRecord Errors " Watch "writeRecord Errors " New topic

writeRecord Errors

Renato Mascardo

Joined: Jul 03, 2003
Posts: 8
Hello all,
I'm having issues with the writeRecord method in the Data class. It eventually gets called by my modify method, however it throws the following exception:

I know that it might be an issue with the deprecated method I replaced, however when I went back to the orginal code it threw the same exception. Are there any requirements or gotchas with the writeRecord method? Should it still work with the old deprecated method? I'm sure it is something small like the offset being wrong or something.
Thanks in advance!
Bharat Ruparel
Ranch Hand

Joined: Jul 30, 2003
Posts: 493
Hello Renato,
May I suggest something? Based on your stacktrace, I can see that you have an ArrayIndexOutOfBound exception which is quite common when dealing with IO. Moreover, you have it coupled with RMI. The way I would go about debugging it is take RMI out of equation. This is assuming that you have the same code executing in local mode as well as RMI. Therefore, work in the local mode until you have these bugs taken care of. I usually write small test programs when I am incrementally building my system. Again, a decent IDE is immensely useful here (I use IntelliJ). Run your test program through the debugger and see what is happening.
Let us know how it works out.

Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11778

Hi Renato,
Bharat has a good point - do you know if this worked properly in local mode?
Did you provide the right number of fields in the DataInfo that you are passing to the update method? My immediate suspicion would be that you are missing a field or two.
Perhaps temporarily add a System.out.println statement in the update method showing you what it believes the contents of DataInfo are.
Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I agree. Here's the link:
subject: writeRecord Errors
It's not a secret anymore!