java.lang.NullPointerException

Terracotta Project Issue Tracker | Sourceforge Tracker | 7 years ago
  1. 0

    It seems like there is a small "bug" in the MulticastServerThread class (file MulticastKeepaliveHeartbeatSender.java). In line 192 (revision 52), the code looks like: if (!socket.isClosed()) { but it would be better if it looked like: if ((socket != null) && (!socket.isClosed())) { because I get a NullPointerException if the application terminates before Java is able to start the thread. If I run the application in the debugger (with a breakpoint), the thread has enough time to create the MulticastSocket object. Exception in thread "main" java.lang.NullPointerException at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender$MulticastServerThread.closeSocket(MulticastKeepaliveHeartbeatSender.java:192) at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender$MulticastServerThread.interrupt(MulticastKeepaliveHeartbeatSender.java:186) at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender.dispose(MulticastKeepaliveHeartbeatSender.java:78) at net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider.dispose(MulticastRMICacheManagerPeerProvider.java:172) at net.sf.ehcache.CacheManager.shutdown(CacheManager.java:526) at go.<init>(go.java:57) at go.main(go.java:21) This is of course not a big problem because it is very rare that an application uses the Cache and terminates THAT quickly.... ;) Thanks, Roman Sourceforge Ticket ID: 1480442 - Opened By: roman_k - 2 May 2006 14:45 UTC

    Terracotta Project Issue Tracker | 7 years ago | Sourceforge Tracker
    java.lang.NullPointerException
  2. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender$MulticastServerThread.closeSocket()
    2. Ehcache
      CacheManager.shutdown
      1. net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender$MulticastServerThread.closeSocket(MulticastKeepaliveHeartbeatSender.java:192)
      2. net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender$MulticastServerThread.interrupt(MulticastKeepaliveHeartbeatSender.java:186)
      3. net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatSender.dispose(MulticastKeepaliveHeartbeatSender.java:78)
      4. net.sf.ehcache.distribution.MulticastRMICacheManagerPeerProvider.dispose(MulticastRMICacheManagerPeerProvider.java:172)
      5. net.sf.ehcache.CacheManager.shutdown(CacheManager.java:526)
      5 frames
    3. Unknown
      go.main
      1. go.<init>(go.java:57)
      2. go.main(go.java:21)
      2 frames