7 Replies Latest reply on Apr 19, 2004 10:12 PM by ben.wang

    Question on error

    cwampler

      I am using the LRUAlgorithm for my puts. They all work perfectly nicely but every once and a while on a put I will get this:

      java.lang.NullPointerException
      at org.jboss.cache.eviction.LRUAlgorithm.processQueues(LRUAlgorithm.java:72)
      at org.jboss.cache.eviction.LRUAlgorithm.process(LRUAlgorithm.java:51)
      at org.jboss.cache.eviction.EvictionTimerTask.run(EvictionTimerTask.java:33)
      at java.util.TimerThread.mainLoop(Timer.java:432)
      at java.util.TimerThread.run(Timer.java:382)

      What is happening on line 72 of LRUAlgorithm that could cause this?

      Thanks,
      Chris

        • 1. Re: Question on error

          Chris,

          Thanks for reporting the problem. Can you give me more detailed info on how can I reproduce the problem? BTW, I am currently out of town and won't be able to look into this problem untill next week.

          Thanks,

          -Ben

          • 2. Re: Question on error
            cwampler

            It is while doing a bulk insert of a few thousand elements and it seems to happen about once every 4 or 5 runs. And it isn't ever really on the same element. Sometimes it will only get through 50 or 60 and sometimes it does 10000 before it crashes.

            Thanks again,
            Chris

            • 3. Re: Question on error
              cwampler

              Ben,

              When you get a chance please let me know what is coming up null. Is it something I can check before each "put"?

              Thanks again,
              Chris

              • 4. Re: Question on error

                Chris,

                I've taken a look at the source code. I can see a chance for the null pointer exception.

                Is there a test case that you can send me to reproduce this problem so I can validate it? I'd like to add it to the JUnit test suite as well.

                Otherwise, I will fix it and have you tested out for me. :-)

                Thanks,

                -Ben

                • 5. Re: Question on error
                  cwampler

                  Unfortunately I couldn't send you the code to test since it is hitting up on the DB (which is constantly changing itself). All I am doing is a mass bulk from a DB table (about 20000 at a time), and they are all just simple strings. ie
                  cache.put("/DBConstant/State", "California", "5");
                  cache.put("/DBConstant/Sex", "Male", "1");
                  cache.put("/DBConstant/UserCode", "Chris", "admin");

                  And I would be more than happy to test it for you.

                  Thanks again for your reply,
                  Chris

                  • 6. Re: Question on error

                    Chris,

                    I have a fix here for you to test it out. Can you send me your email address? Mine is ben.wang@jboss.com. I will mail you the new jar.

                    Thanks,

                    -Ben

                    • 7. Re: Question on error

                      Just to let everyone knows that this bug has been fixed.

                      Thanks,

                      -Ben