This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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! -rjm
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. Regards. Bharat
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