[Topic] ClassCastException on every login coming from server

We're use the server and JSON.
It's been running quite happily for quite awhile (I think we went to JSON in December).
Today we are all receiving an error message at login.
I restarted the server and two of these happened.
(I attempted to login twice!)

Did something get corrupted in the DB?
Some userdata maybe?

Any help would be appreciated.
Of course, it's Friday and I won't get back to this 'till Monday.

-Dan

java.lang.ClassCastException: agiletrack.data.record.History

at agiletrack.server.persistence.TrackerPersistenceDefault.generateUserSummary(TrackerPersistenceDefault.java:191) at agiletrack.server.persistence.TrackerPersistenceDefault.generateRecordSummary(TrackerPersistenceDefault.java:99) at agiletrack.server.persistence.TrackerCachedPersistence.generateRecordSummary(TrackerCachedPersistence.java:126) at agiletrack.server.TrackerModel.getRecordSummary(TrackerModel.java:924) at agiletrack.server.TrackerModel.processRecordSummary(TrackerModel.java:818) at agiletrack.server.TrackerModel.getRecord(TrackerModel.java:800) at agiletrack.server.http.TrackerJSONRPCController.load(TrackerJSONRPCController.java:109) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at agiletrack.server.http.JSONRPCServer.execute(JSONRPCServer.java:75) at agiletrack.server.http.TrackerJSONRPCStreamServer$1.run(TrackerJSONRPCStreamServer.java:85) at java.lang.Thread.run(Thread.java:595)
—Posted by Dan (I'm such an ogre) Mullen on Apr 18, 2008

The error makes me think something might not be right in the database, but I won't be able to look into the code until Tuesday or Wednesday, so I don't have any ideas for how to fix the problem right now. I'll get back to you as soon as I can.

—Posted by Adam Lane on Apr 19, 2008 at 7:23:11 AM

Well, the problem definitely seems to be with the database. A record ID must have been used twice and where an Issue record was expected, the database is storing a History record. I patched the agiletrack-server.jar to bypass this specific error, but I expect the error will happen elsewhere, so it's probably not a sufficient fix.

I've never heard of this happening before so I'm not sure how the database ended up with the problem.

To fix the database, I expect a row needs to be deleted from the "issue" table. To find the row in this case, you'll need to query your agiletrack database directly.

SELECT id FROM history, issue WHERE history.id = issue.id;

If the database doesn't have the problem, no rows should be found. In your case, I expect one row to be matched.

Take the ID returned and delete the row from the issue table.

DELETE FROM issue WHERE id = ?;

I think that will fix the problem. You'll probably want to save the issue details from that row so you can recreate it if needed.

Sorry about the problem and I hope this solution helps.

—Posted by Adam Lane on Apr 22, 2008 at 9:14:10 PM

Make that first query:

SELECT history.id FROM history, issue WHERE history.id = issue.id;

—Posted by Adam Lane on Apr 22, 2008 at 9:15:36 PM


You may post a reply to this topic, but you must be logged in. If you already have an account, you may login now. If you need to create an account, you may also register now.