This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I have an app that allows users to enter financial data, and then balances are generated on the fly. Each user has their own sessions, and their own private accounts. Every once in awhile a user will be funny and do things like spelling the date which causes an error because the app is expecting a number (which I have since fixed... never underestimate the creativeness of your users).
Anyway, once the error is generated, it throws it for all users, and effectively locks up the system for everybody. Is that a Tomcat issue, or a java issue? It makes sense to me that if an error is thrown in one session, it shouldn't be able to affect other users..
I figured it was probably my code, but I couldn't see how it was propagating the error across all users.I wasn't catching an error at all because I thought I had all potential inputs covered.
If I am taking your question correctly, the method that reads my input should be catching the errors?
EDIT: To clarify, when it did detect input that didn't pass the checks I had put in place, an error page displayed. If the input made it past those checks due to my lack of foresight, there was nothing to catch it. [ May 16, 2006: Message edited by: Chad Clites ]
sounds almost like a static variable in a JSP is being set by one instance causing all instances to see it when next they're called.
Joined: Aug 16, 2005
This is the code that is causing the error:
I'm not sure if this is enough code, but this is the part that is causing the error; specifically when parsing the string to an int. This snippet is to check if a date falls within a specific range, and if it does, tick a counter [ May 16, 2006: Message edited by: Chad Clites ]
Also the old and counter variables; how are they being declared and stored?
Joined: Aug 16, 2005
ledger is declared globally: ArrayList ledger = new ArrayList(); counter is declared right before the loop (locally): int counter = 0; old is global also. I can't think right now why I did it that way, because it really only needs to be local.