2 Replies Latest reply: Jul 28, 2009 12:24 PM by greybird RSS

    NullPointerException

    3962
      I got this exception while writing to a database today.

      java.lang.NullPointerException
           at com.sleepycat.je.tree.LN.log(LN.java:534)
           at com.sleepycat.je.tree.LN.log(LN.java:373)
           at com.sleepycat.je.tree.BIN.logDirtyLN(BIN.java:1016)
           at com.sleepycat.je.tree.BIN.evictInternal(BIN.java:985)
           at com.sleepycat.je.tree.BIN.evictLNs(BIN.java:940)
           at com.sleepycat.je.evictor.Evictor.evictIN(Evictor.java:761)
           at com.sleepycat.je.evictor.Evictor.evictBatch(Evictor.java:344)
           at com.sleepycat.je.evictor.Evictor.doEvict(Evictor.java:244)
           at com.sleepycat.je.evictor.Evictor.doCriticalEviction(Evictor.java:269)
           at com.sleepycat.je.dbi.CursorImpl.close(CursorImpl.java:711)
           at com.sleepycat.je.Cursor.close(Cursor.java:326)
           at com.sleepycat.je.Database.putInternal(Database.java:999)
           at com.sleepycat.je.Database.put(Database.java:885)
           at com.sleepycat.persist.PrimaryIndex.putNoReturn(PrimaryIndex.java:428)
           at com.sleepycat.persist.PrimaryIndex.putNoReturn(PrimaryIndex.java:402)
      .....

      Here is our configuration:

      StoreConfig storeConfig = new StoreConfig();
      storeConfig.setAllowCreate(true);
      storeConfig.setTemporary(true);
      storeConfig.setTransactional(false);

      Have you seen this before?

      Trevor
        • 1. Re: NullPointerException
          greybird
          Hi Trevor,

          No, we haven't seen this before.

          I see what's causing the NPE from your stack trace, and it looks like the underlying cause exception is being discarded.

          Is this reproducible? If so, I can give you a one line change that will reveal the underlying exception.

          --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
          • 2. Re: NullPointerException
            greybird
            Trevor,

            The NullPointerException problem has been fixed and this will be in the next 3.3 patch release. The ticket is #17551.

            If you are able to reproduce the problem, it would sure be nice to know what the underlying exception was. Without further information from you, I have to assume it was an IOException (disk full perhaps) or something similar. If you can reproduce it, please apply this tiny change and try it again:
            diff -c -r1.152.2.3 LN.java
            *** src/com/sleepycat/je/tree/LN.java    5 May 2009 19:59:21 -0000    
            1.152.2.3
            --- src/com/sleepycat/je/tree/LN.java    28 Jul 2009 03:45:34 -0000
            ***************
            *** 531,537 ****
                       * If any exception happens during logging, then force this txn
                       * to onlyAbortable. [#15768]
                       */
            !         locker.setOnlyAbortable();
                      throw DE;
                  }
                      clearDirty();
            --- 531,539 ----
                       * If any exception happens during logging, then force this txn
                       * to onlyAbortable. [#15768]
                       */
            !             if (locker != null) {
            !                 locker.setOnlyAbortable();
            !             }
                      throw DE;
                  }
                      clearDirty();
            Thanks,
            --mark