You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Bryan Lewis <br...@maine.rr.com> on 2006/06/06 17:40:58 UTC

puzzling exception in DataRowStore

We got a scary exception yesterday on our production server.  I have no
good reason to think it's a cayenne issue but we're looking at several
possibilities.  I thought I'd mention it here in case it rang a bell
with someone.  Restarting our app server resolved the problem and it
hasn't come back today.  The cayenne version was 1.2B3.  There were no
changes on that server for a couple of weeks.

The first exception report (of 56, until I stopped the server) and the
most common was the following, on a fairly routine SelectQuery:

 java.lang.NullPointerException
 org.apache.commons.collections.map.LRUMap.reuseMapping(LRUMap.java:272)
 org.apache.commons.collections.map.LRUMap.addMapping(LRUMap.java:243)
 org.apache.commons.collections.map.AbstractHashedMap.put(AbstractHashedMap.java:282)
 org.objectstyle.cayenne.access.DataRowStore.processUpdatedSnapshots(DataRowStore.java:537)
 org.objectstyle.cayenne.access.DataRowStore.processSnapshotChanges(DataRowStore.java:496)
 org.objectstyle.cayenne.access.ObjectStore.snapshotsUpdatedForObjects(ObjectStore.java:556)
 org.objectstyle.cayenne.access.ObjectResolver.objectsFromDataRows(ObjectResolver.java:162)
 org.objectstyle.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRows(ObjectResolver.java:137)

 org.objectstyle.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:373)
 org.objectstyle.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:151)
 org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:765)
 org.objectstyle.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:253)
 org.objectstyle.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:90)
 org.objectstyle.cayenne.access.DataContext.onQuery(DataContext.java:1422)
 org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1411)

The line in DataRowStore was:

                DataRow oldSnapshot = (DataRow) snapshots.put(key,
newSnapshot);

That called a method in commons.collections.map.LRUMap:

    protected void reuseMapping(LinkEntry entry, int hashIndex, int
hashCode, Object key, Object value) {
        // find the entry before the entry specified in the hash table
        int removeIndex = hashIndex(entry.hashCode, data.length);
        HashEntry loop = data[removeIndex];
        HashEntry previous = null;
        while (loop != entry) {
            previous = loop;
            loop = loop.next;   // line 272
        }

I guess this says the LRUMap was corrupted somehow.  A HashEntry had a
null 'next' pointer.  Seems like something that couldn't happen, eh?.  I
suppose a cosmic ray could've zapped a memory cell.

Any thoughts?